8000 GitHub - sindresorhus/first-run: Check if it's the first time the process is run
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

sindresorhus/first-run

Repository files navigation

first-run

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
import isFirstRun from 'first-run';

console.log(isFirstRun({name: 'x'}));
$ node x.js
true
$ node x.js
false

API

isFirstRun(options)

clearFirstRun(options)

Clear the state.

options

Type: object

name

Type: string

The name used to identify it.

Usually, you would fetch the name field from package.json.

About

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

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  
0