0.2.0 • Published 8 years ago

check-mate v0.2.0

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

check-mate

Your mate to check files or modules exist in your project

Note: WIP, pretty messy codebase...

CLI

CLI

$ npm install --global check-mate
Usage
  $ check-mate
  // Run on a project folder

Examples
  $ check-mate
  // Will check the default files exist

Contribute

https://github.com/gtrufitt/check-mate

Add checkers

Add a function to lib/checkers.js that returns a Promise and resolves with a chalkified string.

E.g:

checkFileExists: ({humanName, fileName, checker}) => {
  return new Promise(function(resolve, reject) {

    const checkFile = (fileName) =>
       (fs.existsSync(fileName)) ? chalk.green(`Yes, ${fileName} exists`) : chalk.red(`No, ${fileName} doesn't exist`);

    (typeof fileName === 'string') ? resolve(checkFile(fileName)) : resolve(fileName.map(checkFile).join(endOfLine));

  });

You can then use this in the lib/mates.js file, by adding an object, with your new function in the checkers array:

{humanName: 'Riff Raff', fileName: ['riff-raff.yaml', 'deploy.json'], checkers: [checkFileExists]}

Add mates

As above, you can add mates in the lib/mates.js. Mates should have a humanName that'll be used in the check title (Checks for *Linting*) and then some 'checker' specific properties (checkers use destructuring to grab the ones they want).

Publish

npm i -g np

then

np <versionType>

TODO

  • Lint
  • Choose to not show the message if something doesn't exist?
  • Custom checkers as an option / override defaults

License

MIT © Gareth Trufitt

0.2.0

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago

0.0.0

8 years ago