# exprs

The command-line interface for [exprs.sh](https://exprs.sh).

*exprs* is a micromodule hosting and registry service for JavaScript. No worry about setting lint, formatting, transpilations or test runners. Just write and share your code.

## Features

- **Just expression**. A micromodule is a single expression of JavaScript, which will do one thing well.
- **Immutable**. All micromodules are immutable and would never dissapear.
- **Deterministic**. With aliasing, your dependencies are not unintentionally upgraded and are always the exact same.
- **Transpile on install**. The transpilation runs on the installtion phase, so module users can select supporting environments instead of authors.
- **No task setup**. Common tasks like linting and formatting are integrated into the platform.
- **No name collision**. All micromodules have an unique name and can have alias names under your namespace.

## Get started

Install the package from npm:

```sh
npm install --global exprs

# or with `yarn`
yarn global add exprs
```

Install a micromodule:

```sh
exprs add @nkzawa/leftPad
```

Use it on your applications as always you do with node modules:

```js
const leftPage = require("@nkzawa/leftPad");
```

## Commands

### exprs install

Install micromodules defined in `package.json`.
This command is the default so you can execute it as just `exprs`.

```sh
exprs install

# or just
exprs
```

`dependencies` and `devDependencies` are defined on the `exprs` field:

```json
{
  "exprs": {
    "dependencies": {
      "@nkzawa/leftPad": "leftPad_a01",
      "@username/aliasName": "moduleName_b12",
      "someModule_c23": "someModule_c23"
    }
  }
}
```

To not install `devDependencies`, use the `--production` option:

```sh
exprs --production
```

### exprs add \<module|alias...\>

Install a micromodule from the registry and add it to `package.json`.

```sh
exprs add @nkzawa/leftPad
```

To install as `devDependencies`, run with the `--dev` (or `-d`) option:

```sh
exprs add --dev @nkzawa/leftPad
```

### exprs upgrade [alias...]

Upgrade aliases to the latest version of micromodules.

```sh
exprs upgrade
```

### exprs remove \<module|alias...\>

Uninstall a micromodule and remove it from `package.json`.

```sh
exprs remove @nkzawa/leftPad
```

### exprs help

Display the help message.

```sh
exprs help
```

## Integration with npm

When your npm package has dependencies on *exprs* micromodules,
you want to setup a [npm hook script](https://docs.npmjs.com/misc/scripts)
to install micromodules along with `npm install`:

```json
{
  "scripts": {
    "install": "exprs"
  },
  "dependencies": {
    "exprs": "*"
  }
}
```

## License

MIT
