This package has been deprecated

Author message:

No longer maintained.

audit-shelljs

0.1.3 • Public • Published

audit-shelljs

Audit directory properties/content with ShellJS.

  • Declare expectations with chaining. Stop at first failure.
  • refute API for negating any expectation.
  • Call any shelljs method or use wrappers like hasFile().

Build Status

Examples

Expect: README.md exists, no line with console.log under lib/

var audit = new auditShelljs.create();
audit
  .set('dir', '/path/to/dir'); // Target directory
  .hasFile('README.md')
  .refute.grep('console.log', 'lib/**/*.js');
 
if (audit.pass()) {
  // Expectations met
} else {
  var rule = audit.last();
  console.log(
    'failed because rule %s with args %s returned %s',
    rule.name, JSON.stringify(rule.args), JSON.stringify(rule.res)
  );
}

Expect: Symlink present/absent

Use _() to run any ShellJS method.

audit._('test', '-L', 'mySymLink');
audit.refute._('test', '-L', 'mySymLink');

Expect: Custom rule

assert() and refute() receive an OuterShelljs instance, shelljs.

audit.assert('should ...', function(shelljs) {
  var result = false;
  // ...
  return result;
});
 
audit.refute('should ...', function(shelljs) {
  var result = false;
  // ...
  return result;
});

Installation

NPM

npm install audit-shelljs

API

Documentation

License

MIT

Tests

npm test

Dependencies (1)

Dev Dependencies (11)

Package Sidebar

Install

npm i audit-shelljs

Weekly Downloads

1

Version

0.1.3

License

MIT

Last publish

Collaborators

  • codeactual