first-run
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

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.

Package Sidebar

Install

npm i first-run

Weekly Downloads

442

Version

3.0.0

License

MIT

Unpacked Size

3.55 kB

Total Files

5

Last publish

Collaborators

  • sindresorhus