0.47.27 • Published 3 years ago

supi v0.47.27

Weekly downloads
1,396
License
MIT
Repository
-
Last release
3 years ago

supi

Fast, disk space efficient installation engine. Used by pnpm

Status Windows build status

Install

Install it via npm.

npm install supi

It also depends on @pnpm/logger version 1, so install it as well via:

npm install @pnpm/logger@1

API

supi.installPkgs(pkgsToInstall, [options])

Install packages.

Arguments:

  • pkgsToInstall - Object | String[] - either an object that maps package names to version ranges or inputs usually passed to npm install (e.g., foo@1.0.0, foo).
  • options.storeController - Object - required. An object that does all the manipulations with the store.
  • options.store - String - required. Location of the store.
  • options.saveProd - Boolean - package will appear in dependencies.
  • options.saveDev - Boolean - package will appear in devDependencies.
  • options.saveOptional - Boolean - package will appear in optionalDependencies.
  • options.saveExact - Boolean - saved dependencies will be configured with an exact version rather than using npm's default semver range operator.
  • options.global - Boolean - the packages will be installed globally rather than locally.
  • options.prefix - String - the directory in which the installation will be performed. By default the process.cwd() value is used.
  • options.reporter - Function - A function that listens for logs.
  • options.packageManager - Object - The package.json of the package manager.
  • options.hooks - Object - A property that contains installation hooks. Hooks are documented separately.
  • options.shrinkwrap - Boolean - true by default. When false, ignores the shrinkwrap.yaml file and doesn't create/update one.
  • options.shrinkwrapOnly - Boolean - false by default. When true, only updates shrinkwrap.yaml and package.json instead of checking node_modules and downloading dependencies.

Returns: a Promise

Example:

const pnpm = require('pnpm')

pnpm.installPkgs({
  'is-positive': '1.0.0',
  'hello-world': '^2.3.1'
}, { saveDev: true })

supi.install([options])

Install all modules listed as dependencies in package.json.

Arguments: (same as in named install and additionally)

  • options.production - Boolean - true by default. If true, packages listed in dependencies will be installed.
  • options.development - Boolean - true by default. If true, packages listed in devDependencies will be installed.
  • options.optional - Boolean - Has the value of options.production by default. If true, packages listed in optionalDependencies will be installed. Can be true only when options.production is true as well.
  • options.frozenShrinkwrap - Boolean - false by default. When true, shrinkwrap file is not generated and installation fails if an update is needed. With this option, a headless installation is performed. A headless installation is ~33% faster than a regular one because it skips dependencies resolution and peers resolution.
  • options.preferFrozenShrinkwrap - Boolean - false by default. When true, a headless installation is performed if the shrinkwrap file is up-to-date with the package.json file.

supi.uninstall(pkgsToUninstall, [options])

Uninstalls a package, completely removing everything pnpm installed on its behalf.

Arguments:

  • pkgsToUninstall - String[] - the package names to be uninstalled.
  • options.saveProd - Boolean - the package will be removed from dependencies.
  • options.saveDev - Boolean - the package will be removed from devDependencies.
  • options.saveOptional - Boolean - the package will be removed from optionalDependencies.
  • options.global - Boolean - the packages will be uninstalled globally.
  • options.reporter - Function - A function that listens for logs.

supi.link(linkFromPkgs, linkToNodeModules, [options])

Create symbolic links from the linked packages to the target package's node_modules (and its node_modules/.bin).

Arguments:

  • linkFromPkgs - String[] - paths to the packages that should be linked.
  • linkToNodeModules - String - path to the dependent package's node_modules directory.
  • options.reporter - Function - A function that listens for logs.

supi.linkToGlobal(linkFrom, options)

Create a symbolic link from the specified package to the global node_modules.

Arguments:

  • linkFrom - String - path to the package that should be linked.
  • globalPrefix - String - path to the global directory.
  • options.reporter - Function - A function that listens for logs.

supi.linkFromGlobal(pkgNames, linkTo, options)

Create symbolic links from the global pkgNames to the linkTo/node_modules folder.

Arguments:

  • pkgNames - String[] - packages to link.
  • linkTo - String - package to link to.
  • globalPrefix - String - path to the global directory.
  • options.reporter - Function - A function that listens for logs.

supi.unlink([options])

Unlinks all packages that were linked during development in a project. If the linked package is in package.json of the project, it is installed after unlinking.

Arguments:

  • options.prefix - String - by default process.cwd(). Path to the project.
  • options.reporter - Function - A function that listens for logs.

supi.unlinkPkgs(pkgsToUnlink, [options])

Unlinks the listed packages that were linked during development in a project. If the linked package is in package.json of the project, it is installed after unlinking.

Arguments:

  • pkgsToUnlink - String[] - the list of packages that have to be unlinked. If the passed in package is not an external link, then a warning is reported.
  • options.prefix - String - by default process.cwd(). Path to the project.
  • options.reporter - Function - A function that listens for logs.

supi.prune([options])

Remove extraneous packages. Extraneous packages are packages that are not listed on the parent package's dependencies list.

Arguments:

  • options.production - Boolean - by default false. If this property is true, prune will remove the packages specified in devDependencies.
  • options.prefix - String - by default process.cwd().
  • options.reporter - Function - A function that listens for logs.

supi.storeStatus([options])

Return the list of modified dependencies.

Arguments:

  • options.reporter - Function - A function that listens for logs.

Returns: Promise<string[]> - the paths to the modified packages of the current project. The paths contain the location of packages in the store, not in the projects node_modules folder.

supi.storePrune([options])

Remove unreferenced packages from the store.

Hooks

Hooks are functions that can step into the installation process.

readPackage(pkg)

This hook is called with every dependency's manifest information. The modified manifest returned by this hook is then used by supi during installation.

Example:

const supi = require('supi')

supi.installPkgs({
  hooks: {readPackage}
})

function readPackage (pkg) {
  if (pkg.name === 'foo') {
    pkg.dependencies = {
      bar: '^2.0.0',
    }
  }
  return pkg
}

Acknowledgements

Thanks to Valentina Kozlova for the supi logo

License

MIT

0.47.27

3 years ago

0.47.26

3 years ago

0.47.25

3 years ago

0.47.24

3 years ago

0.47.23

3 years ago

0.47.22

3 years ago

0.47.21

3 years ago

0.47.20

3 years ago

0.47.19

3 years ago

0.47.18

3 years ago

0.47.17

3 years ago

0.47.16

3 years ago

0.47.15

3 years ago

0.47.14

3 years ago

0.47.13

3 years ago

0.47.12

3 years ago

0.47.11

3 years ago

0.47.10

3 years ago

0.47.9

3 years ago

0.47.8

3 years ago

0.47.7

3 years ago

0.47.5

3 years ago

0.47.6

3 years ago

0.47.4

3 years ago

0.47.3

3 years ago

0.47.2

3 years ago

0.47.1

3 years ago

0.47.0

3 years ago

0.46.18

4 years ago

0.46.17

4 years ago

0.46.16

4 years ago

0.46.15

4 years ago

0.46.14

4 years ago

0.46.13

4 years ago

0.46.4

4 years ago

0.46.5

4 years ago

0.46.8

4 years ago

0.46.9

4 years ago

0.46.6

4 years ago

0.46.7

4 years ago

0.46.12

4 years ago

0.46.11

4 years ago

0.46.10

4 years ago

0.46.3

4 years ago

0.46.2

4 years ago

0.46.1

4 years ago

0.46.0

4 years ago

0.45.3

4 years ago

0.45.4

4 years ago

0.45.2

4 years ago

0.44.8

4 years ago

0.45.1

4 years ago

0.45.0

4 years ago

0.44.7

4 years ago

0.44.6

4 years ago

0.44.5

4 years ago

0.44.4

4 years ago

0.44.3

4 years ago

0.44.2

4 years ago

0.44.1

4 years ago

0.44.0

4 years ago

0.43.29

4 years ago

0.43.28

4 years ago

0.43.27

4 years ago

0.43.26

4 years ago

0.43.25

4 years ago

0.43.24

4 years ago

0.43.22

4 years ago

0.43.23

4 years ago

0.43.21

4 years ago

0.43.20

4 years ago

0.43.19

4 years ago

0.43.18

4 years ago

0.43.17

4 years ago

0.43.16

4 years ago

0.43.15

4 years ago

0.43.14

4 years ago

0.43.13

4 years ago

0.43.12

4 years ago

0.43.11

4 years ago

0.43.10

4 years ago

0.43.9

4 years ago

0.43.8

4 years ago

0.43.7

4 years ago

0.43.6

4 years ago

0.43.5

4 years ago

0.43.4

4 years ago

0.43.3

4 years ago

0.43.2

4 years ago

0.43.1

4 years ago

0.43.0

4 years ago

0.42.0

4 years ago

0.41.31

4 years ago

0.41.30

4 years ago

0.41.29

4 years ago

0.41.28

4 years ago

0.41.27

4 years ago

0.41.26

4 years ago

0.41.25

4 years ago

0.41.24

4 years ago

0.41.22

4 years ago

0.41.23

4 years ago

0.0.0-2020811527

4 years ago

0.41.21

4 years ago

0.41.20

4 years ago

0.41.19

4 years ago

0.41.18

4 years ago

0.41.16

4 years ago

0.41.17

4 years ago

0.41.15

4 years ago

0.41.14

4 years ago

0.41.13

4 years ago

0.41.12

4 years ago

0.41.11

4 years ago

0.41.10

4 years ago

0.41.9

4 years ago

0.41.8

4 years ago

0.41.7

4 years ago

0.41.6

4 years ago

0.41.5

5 years ago

0.41.4

5 years ago

0.41.3

5 years ago

0.41.2

5 years ago

0.41.1

5 years ago

0.41.0

5 years ago

0.40.1

5 years ago

0.40.0

5 years ago

0.39.10

5 years ago

0.39.9

5 years ago

0.39.8

5 years ago

0.39.7

5 years ago

0.39.6

5 years ago

0.39.5

5 years ago

0.39.4

5 years ago

0.39.3

5 years ago

0.39.1

5 years ago

0.39.0

5 years ago

0.39.2

5 years ago

0.38.31

5 years ago

0.39.0-alpha.7

5 years ago

0.39.0-alpha.6

5 years ago

0.39.0-alpha.5

5 years ago

0.39.0-alpha.4

5 years ago

0.39.0-alpha.3

5 years ago

0.38.30

5 years ago

0.39.0-alpha.2

5 years ago

0.38.29

5 years ago

0.39.0-alpha.0

5 years ago

0.39.0-alpha.1

5 years ago

0.38.28

5 years ago

0.38.27

5 years ago

0.38.26

5 years ago

0.38.25

5 years ago

0.38.24

5 years ago

0.38.23

5 years ago

0.38.22

5 years ago

0.38.21

5 years ago

0.38.20

5 years ago

0.38.19

5 years ago

0.38.18

5 years ago

0.38.17

5 years ago

0.38.16

5 years ago

0.38.15

5 years ago

0.38.14

5 years ago

0.38.13

5 years ago

0.38.12

5 years ago

0.38.11

5 years ago

0.38.10

5 years ago

0.38.9

5 years ago

0.38.8

5 years ago

0.38.7

5 years ago

0.38.6

5 years ago

0.38.5

5 years ago

0.38.4

5 years ago

0.38.3

5 years ago

0.38.3-1

5 years ago

0.38.3-0

5 years ago

0.38.2

5 years ago

0.38.1

5 years ago

0.38.0

5 years ago

0.37.6

5 years ago

0.37.5

5 years ago

0.37.4

5 years ago

0.37.3

5 years ago

0.37.2

5 years ago

0.37.1

5 years ago

0.37.0

5 years ago

0.36.6

5 years ago

0.36.5

5 years ago

0.36.4

5 years ago

0.36.3

5 years ago

0.36.2

5 years ago

0.36.1

5 years ago

0.36.0

5 years ago

0.35.7

5 years ago

0.35.6

5 years ago

0.35.5

5 years ago

0.35.4

5 years ago

0.35.3

5 years ago

0.35.2

5 years ago

0.35.1

5 years ago

0.35.0

5 years ago

0.35.0-5

5 years ago

0.35.0-4

5 years ago

0.35.0-3

5 years ago

0.35.0-2

5 years ago

0.35.0-1

5 years ago

0.35.0-0

5 years ago

0.34.11

5 years ago

0.34.10

5 years ago

0.34.9

5 years ago

0.34.8

5 years ago

0.34.7

5 years ago

0.34.6

5 years ago

0.34.5

5 years ago

0.34.4

5 years ago

0.34.3

5 years ago

0.34.2

5 years ago

0.34.1

5 years ago

0.34.0

6 years ago

0.33.9

6 years ago

0.33.8

6 years ago

0.33.7

6 years ago

0.33.7-2

6 years ago

0.33.7-1

6 years ago

0.33.7-0

6 years ago

0.33.6

6 years ago

0.33.5

6 years ago

0.33.4

6 years ago

0.33.3

6 years ago

0.33.2

6 years ago

0.33.1

6 years ago

0.33.0

6 years ago

0.32.2

6 years ago

0.32.1

6 years ago

0.32.0

6 years ago

0.31.3

6 years ago

0.31.2

6 years ago

0.31.1

6 years ago

0.31.0

6 years ago

0.30.2

6 years ago

0.30.1

6 years ago

0.30.0

6 years ago

0.30.0-4

6 years ago

0.30.0-3

6 years ago

0.30.0-2

6 years ago

0.30.0-1

6 years ago

0.29.6

6 years ago

0.30.0-0

6 years ago

0.29.5

6 years ago

0.29.4

6 years ago

0.29.3

6 years ago

0.29.2

6 years ago

0.29.1

6 years ago

0.29.0

6 years ago

0.28.3

6 years ago

0.28.2

6 years ago

0.28.1

6 years ago

0.28.0

6 years ago

0.27.4

6 years ago

0.27.3

6 years ago

0.27.2

6 years ago

0.27.1

6 years ago

0.27.0

6 years ago

0.26.2

6 years ago

0.26.1

6 years ago

0.26.0

6 years ago

0.26.0-0

6 years ago

0.25.11

6 years ago

0.25.10

6 years ago

0.25.9

6 years ago

0.25.8

6 years ago

0.25.8-2

6 years ago

0.25.8-1

6 years ago

0.25.8-0

6 years ago

0.25.7

6 years ago

0.25.6

6 years ago

0.25.5

6 years ago

0.25.4

6 years ago

0.25.3

6 years ago

0.25.2

6 years ago

0.25.1

6 years ago

0.25.0

6 years ago

0.24.13-3

6 years ago

0.24.13-2

6 years ago

0.24.13-1

6 years ago

0.24.13-0

6 years ago

0.24.12

6 years ago

0.24.11-0

6 years ago

0.24.11

6 years ago

0.24.10

6 years ago

0.24.9

6 years ago

0.24.8

6 years ago

0.24.7

6 years ago

0.24.6

6 years ago

0.24.5

6 years ago

0.24.4

6 years ago

0.24.3

6 years ago

0.24.2

6 years ago

0.24.1

6 years ago

0.24.0

6 years ago

0.23.2

6 years ago

0.23.1

6 years ago

0.23.0

6 years ago

0.22.2

6 years ago

0.22.1

6 years ago

0.22.0

6 years ago

0.21.1

6 years ago

0.21.0

6 years ago

0.20.9

6 years ago

0.20.8

6 years ago

0.20.7

6 years ago

0.20.6

7 years ago

0.20.5

7 years ago

0.20.4

7 years ago

0.20.3

7 years ago

0.20.2

7 years ago

0.20.1

7 years ago

0.20.0

7 years ago

0.19.3

7 years ago

0.19.2

7 years ago

0.19.1

7 years ago

0.19.0

7 years ago

0.18.2

7 years ago

0.18.1

7 years ago

0.18.0

7 years ago

0.17.4

7 years ago

0.17.3

7 years ago

0.17.2

7 years ago

0.17.1

7 years ago

0.17.0

7 years ago

0.16.9

7 years ago

0.16.8

7 years ago

0.16.7

7 years ago

0.16.6

7 years ago

0.16.5

7 years ago

0.16.4

7 years ago

0.16.3

7 years ago

0.16.2

7 years ago

0.16.1

7 years ago

0.16.0

7 years ago

0.15.0

7 years ago

0.14.13

7 years ago

0.14.12

7 years ago

0.14.11

7 years ago

0.14.10

7 years ago

0.14.9

7 years ago

0.14.8

7 years ago

0.14.7

7 years ago

0.14.6

7 years ago

0.14.5

7 years ago

0.14.4

7 years ago

0.14.3

7 years ago

0.14.2

7 years ago

0.14.1

7 years ago

0.14.0

7 years ago

0.13.2

7 years ago

0.13.1

7 years ago

0.13.0

7 years ago

0.12.14

7 years ago

0.12.13

7 years ago

0.12.12

7 years ago

0.12.11

7 years ago

0.12.10

7 years ago

0.12.9

7 years ago

0.12.8

7 years ago

0.12.7

7 years ago

0.12.6

7 years ago

0.12.5

7 years ago

0.12.4

7 years ago

0.12.3

7 years ago

0.12.2

7 years ago

0.12.1

7 years ago

0.12.0

7 years ago

0.11.3

7 years ago

0.11.2

7 years ago

0.11.1

7 years ago

0.11.0

7 years ago

0.10.0

7 years ago

0.9.0

7 years ago

0.8.3

7 years ago

0.8.2

7 years ago

0.8.1

7 years ago

0.8.0

7 years ago

0.7.17

7 years ago

0.7.16

7 years ago

0.7.15

7 years ago

0.7.14

7 years ago

0.7.13

7 years ago

0.7.12

7 years ago

0.7.11

7 years ago

0.7.10

7 years ago

0.7.9

7 years ago

0.7.8

7 years ago

0.7.7

7 years ago

0.7.6

7 years ago

0.7.5

7 years ago

0.7.4

7 years ago

0.7.3

7 years ago

0.7.2

7 years ago

0.7.1

7 years ago

0.7.0

7 years ago

0.7.0-1

7 years ago

0.7.0-0

7 years ago

0.6.3

7 years ago

0.6.2

7 years ago

0.6.1

7 years ago

0.6.0

7 years ago

0.5.3

7 years ago

0.5.2

7 years ago

0.5.1

7 years ago

0.5.0

7 years ago

0.4.1

7 years ago

0.2.37

7 years ago

0.2.36

7 years ago

0.2.35

7 years ago

0.2.34

7 years ago

0.2.33

7 years ago

0.2.32

7 years ago

0.2.31

7 years ago

0.2.30

7 years ago

0.2.29

7 years ago

0.2.28

7 years ago

0.2.27

7 years ago

0.2.26

7 years ago

0.2.25

7 years ago

0.2.24

7 years ago

0.2.23

7 years ago

0.2.22

7 years ago

0.2.21

7 years ago

0.2.20

7 years ago

0.2.19

7 years ago

0.2.18

7 years ago

0.2.17

7 years ago

0.2.16

7 years ago

0.2.15

7 years ago

0.4.0

7 years ago

0.3.0

7 years ago

0.2.14

7 years ago

0.2.13

7 years ago

0.2.12

7 years ago

0.2.11

7 years ago

0.2.10

7 years ago

0.2.9

7 years ago

0.2.8

7 years ago

0.2.7

7 years ago

0.2.6

7 years ago

0.2.5

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.10

7 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago

0.0.0

8 years ago