Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/noqcks/generated
Generated will detect files that have been generated by computers
https://github.com/noqcks/generated
Last synced: about 2 months ago
JSON representation
Generated will detect files that have been generated by computers
- Host: GitHub
- URL: https://github.com/noqcks/generated
- Owner: noqcks
- License: mit
- Created: 2018-11-28T16:01:40.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-10-12T13:02:07.000Z (about 1 year ago)
- Last Synced: 2024-11-02T11:24:29.605Z (2 months ago)
- Language: JavaScript
- Size: 7.34 MB
- Stars: 7
- Watchers: 3
- Forks: 8
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Generated
[![Build Status](https://travis-ci.org/noqcks/generated.svg?branch=master)](https://travis-ci.org/noqcks/generated)
Not all files are written by humans. Generated will detect files that have been
generated by computers. Items like a `package-lock.json` or files in `node_modules`.For a full list of generated files detected, see [generated.js](lib/generated.js).
This project is largely a node.js port of the `generated` functionality of [GitHub linguist](https://github.com/github/linguist). The versioning of this project will follow the versioning of linguist.
# Installation
```
npm i @noqcks/generated
```https://www.npmjs.com/package/@noqcks/generated
# Usage
See file [scripts/example.js](scripts/example.js) for an example of usage.
```
const fs = require('fs');
const path = require('path');
const Generated = require("@noqcks/generated");const fileName = "JavaScript/json2_backbone.js"
const filePath = path.join("./samples", fileName);try {
var contents = fs.readFileSync(filePath, 'utf8');
} catch (e) {
if (e.code !== 'ENOENT') throw err;
var contents = ''
}const g = new Generated(name, contents)
console.log(g.isGenerated())
```# LICENSE
[MIT](LICENSE) © 2022 Benji Visser