Check if it's the first time the process is run
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.editorconfig init Jul 13, 2015
.gitattributes init Jul 13, 2015
.gitignore init Jul 13, 2015
.travis.yml init Jul 13, 2015
index.js tweaks Sep 8, 2015
license init Jul 13, 2015
package.json 1.2.0 Apr 6, 2016
readme.md tweaks Sep 8, 2015
test.js Close #3 PR: Add clear option. Sep 8, 2015
test2.js Close #3 PR: Add clear option. Sep 8, 2015
test3.js add XO Sep 8, 2015

readme.md

first-run Build Status

Check if it's the first time the process is run

Can be used to greet the user the first time they use your CLI app, show usage tip, initialize something, etc.

Install

$ npm install --save first-run

Usage

// x.js
var firstRun = require('first-run');

console.log(firstRun());
$ node x.js
true
$ node x.js
false

API

firstRun([options])

options.name

Type: string
Default: name field in your package.json

The name used to identify it.

firstRun.clear()

Clear the state.

License

MIT © Sindre Sorhus