Skip to content

Generated will detect files that have been generated by computers

License

Notifications You must be signed in to change notification settings

noqcks/generated

Repository files navigation

Generated

Build Status

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.

This project is largely a node.js port of the generated functionality of 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 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 © 2022 Benji Visser [email protected]

About

Generated will detect files that have been generated by computers

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •