Documentation menu

Getting started

Your first project

Install Flog first. This walkthrough starts in an empty directory. Have Node.js available to run the example script.

Initialize#

mkdir hello-flog
cd hello-flog
flog init

flog init creates a minimal module manifest, resolves the lockfile, and installs the graph. An existing package.json is never overwritten.

Add a dependency#

flog add primate

Flog deliberately updates package.json and flog.lock, then installs the result. Use flog add --dev for development dependencies.

Run a script#

Add a scripts field to your package.json:

{
  "scripts": {
    "hello": "node -e \"console.log('Hello from Flog')\""
  }
}

Keep the other manifest fields, then run:

flog run hello

Commit the reproducible graph#

Review and commit package.json and flog.lock. Future installs use:

flog install

That command installs the accepted graph, not newer versions. See managing dependencies for deliberate changes and scripts and binaries for running project tools.