npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

espoir-cli

v1.3.1

Published

NodeJS dependency management, and useful tools for monorepo.

Downloads

61

Readme

espoir-cli

Languages


Commands

espoir {create, new}

  • If the current working directory is relative to a espoir monorepo, create a new package inside it.

Some templates are available when you create a package. They are maintained by espoir-cli.

  • If the current working directory is NOT relative to a espoir monorepo, then create a new monorepo.

espoir {install, i, ins}

Add new dependency (dependencies) to the given (or all) package, or install the defined dependencies.

Arguments

optional module-names

Names of dependencies, split by spaces.

It's useful to limit the version of a dependency by typing it in the shape of module_name@version_range.

If this argument is not given, the command will be regarded as installing the defined dependencies in package.json.

Options

{--save, -S} (default: true)

Add the dependencies as dependencies.

When module-names is given, --save flag is default to be true.

If the root package is included, --save flag will lead to an error. Remember that we use the root package only to do something in the development environment, the root package should have no effects on the product. So dependencies in the root package is not allowed. Please use --save-dev to add the dependencies as devDependencies, or just exclude the root package.

{--save-dev, -D} (default: false)

Add the dependencies as devDependencies.

When module-names is given, --save-dev flag is default to be false.

--production (default: false)

When module-names is not given, in other word, installing the defined dependencies, enable --production flag to do installation in production mode. This flag is default to be false.

{--workspace, -w} <workspace...>

Set the package(s) in which to install the dependencies. Default to be all the packages (including the root package).

Examples

  • espoir install

Install all defined dependencies in all the packages (including the root package).

  • espoir install --production

Install all defined dependencies, exclusive of devDependencies, in all the packages (including the root package).

  • espoir install -w root foo

Install all defined dependencies in package foo and the root package.

  • espoir i react react-dom -w foo

Install dependencies react, react-dom in package foo and append them to the dependencies of foo.

  • espoir i --save-dev @types/react @types/react-dom -w root foo

Install dependencies @types/react, @types/react-dom in both package foo and the root package, and append them to the devDependencies of the two packages.

  • espoir install -h

Show help info.


espoir {run-script, run, r}

Execute a defined script.

For each package, executable scripts includes

  • scripts defined in package.json.

  • JS file in the scripts/ directory.

  • JS file in the tasks/ directory.

Arguments

optional command

Name of the script.

It's useful to call a script in one package like package_name.script_name.

When package_name is not given, it will use the directory of the closest package.json as the current working directory.

optional args

Arguments for the script.

Options

--list (default: false)

When command is not given, activate --list flag to get all available scripts.

Examples

  • espoir run-scripts foo.build

Execute script build defined in package.json in package foo.

  • espoir run-scripts --list

Show all available scripts.

  • (/packages/foo/src/utils/) espoir run dev

Execute script dev defined in package.json in package foo.

  • (/packages/) espoir run bootstrap

Execute script bootstrap defined in package.json in the root package.

  • espoir run -h

Show help info.


espoir {contribute, contr, cont, c, commit}

Commit the changes.

Examples.

  • espoir contribute

Start commit interaction.

It contains these steps:

  1. Check git state. If some changes are not staged yet, it will send warnings, and allow you to 1) include automatically 2) retry after operation 3) abort this commit task 4) ignore the warnings and continue to commit

  2. Requires for several questions to generate the changelog and the commit message.

  3. Do git commit.

  4. Do git push if necessary.

  • espoir contribute -h

Show help info.


espoir {uninstall, uni, u, del, remove}

Remove dependencies from the package(s).

If one dependency does not actually exist, it will be skipped.

While uninstalling, modules which is not depended on (by other packages or modules) any more will be cleaned.

If one dependency depended on by other packages or modules is to be uninstalled from one package, it will be removed only from the configuration of the package, but not physically removed.

Arguments

module-names

Names of the modules that is to uninstalled.

Options

--here (default: false)

Set the package from which should the dependencies be removed to the current working package.

Use --here flag only when you're sure about your current working directory, and do not use --workspace at the same time.

{--workspace, -w} <...workspace>

Set the packages from which should the dependencies be removed.

Unable to use when --here flag is enabled. Otherwise, this option is necessary.

Examples

  • espoir uninstall axios jquery -w foo

Uninstall dependencies axios and jquery from package foo.

  • (/packages/foo/src/utils/) espoir del axios --here

Uninstall dependency axios from package foo.

  • espoir uni -h

Show help info.


espoir {use-static, use, static, export}

Mark the local package(s) as exportable, to be installed and imported from other packages.

Arguments

packages

Names of the packages you want to export.

Examples

  • espoir use-static foo

Mark package foo as exportable.

  • espoir use-static -h

Show help info.


espoir update

Update espoir-cli in npm global directory.

Example

  • espoir update

Execute npm install -g espoir-cli@latest.