# audit-shelljs

> Audit directory properties/content with ShellJS

Latest version **0.1.3** (published 2013-05-23) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install audit-shelljs
pnpm add audit-shelljs
yarn add audit-shelljs
bun add audit-shelljs
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2013-05-23 |
| First published | 2013-05-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | codeactual |
| Keywords | shelljs, outer-shelljs, audit, test |

## Links

- npm: https://www.npmjs.com/package/audit-shelljs
- Repository: https://github.com/codeactual/audit-shelljs
- Issues: https://github.com/codeactual/audit-shelljs/issues
- npm.io page: https://npm.io/package/audit-shelljs

## Dependencies (1)

- [outer-shelljs](https://npm.io/package/outer-shelljs.md) ~0.3.3

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads
- [aws-elasticsearch-connector](https://npm.io/package/aws-elasticsearch-connector.md) — 37.4K weekly downloads

## Recent versions

- 0.1.3 (latest) — 2013-05-23
- 0.1.2 — 2013-05-08
- 0.1.1 — 2013-05-07
- 0.1.0 — 2013-05-07

## README

# audit-shelljs

Audit directory properties/content with [ShellJS](https://github.com/arturadib/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](https://travis-ci.org/codeactual/audit-shelljs.png)](https://travis-ci.org/codeactual/audit-shelljs)

## Examples

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

```js
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 [_()](docs/AuditShelljs.md) to run any [ShellJS](http://documentup.com/arturadib/shelljs#command-reference) method.

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

### Expect: Custom rule

[assert()](docs/AuditShelljs.md) and [refute()](docs/AuditShelljs.md) receive an [OuterShelljs](https://github.com/codeactual/outer-shelljs/blob/master/docs/OuterShelljs.md) instance, `shelljs`.

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

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

## Installation

### [NPM](https://npmjs.org/package/audit-shelljs)

    npm install audit-shelljs

## API

[Documentation](docs/AuditShelljs.md)

## License

  MIT

## Tests

    npm test

---
_Source: https://npm.io/package/audit-shelljs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
