0.3.1 • Published 3 years ago

node-project-validator v0.3.1

Weekly downloads
1,787
License
MIT
Repository
github
Last release
3 years ago

node-project-validator

Node.js CI

A basic Node.js project validator

Install

npm i node-project-validator

Usage

const validator = require('node-project-validator');

// The first parameter is the project root directory
// The second parameter is a flag to choose if the validator
// will handle with an error message + process.exit(1)
// (in case flag === true) or return a boolean (flag === false)
// then you can handle with message you want.
validator.hasPackageJson('.', false);

console.log(validator.hasPackageJson('project_dir', false));
true

console.log(validator.hasPackageJson('project_dir/test/', true));
'This is not a Node.js project (no package.json found).'

// others functions:

validator.hasDependencies('.', false);
validator.hasDevDependencies('.', false);
validator.hasAnyDependencies('.', false);
validator.hasNodeModules('.', false);
0.3.1

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago