exprs
v0.1.0
Published
A micromodule hosting and registry for JavaScript
Downloads
2
Readme
exprs
The command-line interface for 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:
npm install --global exprs
# or with `yarn`
yarn global add exprs
Install a micromodule:
exprs add @nkzawa/leftPad
Use it on your applications as always you do with node modules:
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
.
exprs install
# or just
exprs
dependencies
and devDependencies
are defined on the exprs
field:
{
"exprs": {
"dependencies": {
"@nkzawa/leftPad": "leftPad_a01",
"@username/aliasName": "moduleName_b12",
"someModule_c23": "someModule_c23"
}
}
}
To not install devDependencies
, use the --production
option:
exprs --production
exprs add <module|alias...>
Install a micromodule from the registry and add it to package.json
.
exprs add @nkzawa/leftPad
To install as devDependencies
, run with the --dev
(or -d
) option:
exprs add --dev @nkzawa/leftPad
exprs upgrade [alias...]
Upgrade aliases to the latest version of micromodules.
exprs upgrade
exprs remove <module|alias...>
Uninstall a micromodule and remove it from package.json
.
exprs remove @nkzawa/leftPad
exprs help
Display the help message.
exprs help
Integration with npm
When your npm package has dependencies on exprs micromodules,
you want to setup a npm hook script
to install micromodules along with npm install
:
{
"scripts": {
"install": "exprs"
},
"dependencies": {
"exprs": "*"
}
}
License
MIT