first-run
Check if it's the first time the process is run
Last updated 7 months ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install first-run 
SYNC missed versions from official npm registry.

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 first-run

Usage

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

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

API

firstRun([options])

firstRun.clear([options])

Clear the state.

options

Type: Object

name

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

The name used to identify it.

License

MIT © Sindre Sorhus

Current Tags

  • 2.0.0                                ...           latest (7 months ago)

4 Versions

  • 2.0.0                                ...           7 months ago
  • 1.2.0                                ...           4 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.0                                ...           4 years ago

Copyright 2014 - 2016 © taobao.org |