Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/weisjohn/best


https://github.com/weisjohn/best

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

# best

run arbitrarily defined best practice tests

### quick start

1. Clone the repo: `git clone https://github.com/clevertech/Best.git`
2. Install dependencies `npm install`
3. Create a global binary for the cli `npm link`

### usage

```javascript
var config = { 'url': 'http://example.net/' };

best(config, function(err, rules) {
console.log('failing rules', rules.fail);
console.log('passing rules', rules.pass);
});
```

### cli

First, define a [`.bestrc`](./.bestrc) file in the directory you wish to use, then run `$ best`. If any rules fail, `best` returns a non-zero exit code. This is helpful if you wish to include it as part of a build process.

Alternatively, specify config via command-line parameters: `$ best --url http://example.net`

`best` also has a simple JSON reporter, if you wish to capture the output: `$ best -o`

### configuration

`best` ships with [predefined rules](./rules/README.md), which you may ignore by adding to your config a `rules` object, with the name of the rule marked as ignore, similar to `.eslintrc` configuration:

```javascript
{
"url": "http://example.net/",
"rules": {
"cache": [0]
}
}
```

You can additionally specify [your own rules](./rules/README.md) by attaching them to the "rules" object.

### debug

`best` uses [`debug`](https://www.npmjs.com/package/debug) heavily to show what's going on under the hood: `$ DEBUG="best:*" best`