-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from cnpm/npm_cache_env
fix: add prepublish script after postinstall
- Loading branch information
Showing
10 changed files
with
109 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -166,6 +166,8 @@ app/ | |
|
||
## Benchmarks | ||
|
||
### cnpmjs.org install | ||
|
||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
|
@@ -179,6 +181,25 @@ pnpm | 0m13.509s | 0m11.650s | 0m4.443s | |
npm | 0m28.171s | 0m26.085s | 0m8.219s | ||
npm with cache | 0m20.939s | 0m19.415s | 0m6.302s | ||
|
||
### pnpm benchmark | ||
|
||
see https://github.com/rstacruz/pnpm#benchmark | ||
|
||
```bash | ||
npminstall babel-preset-es2015 browserify chalk debug minimist mkdirp | ||
real 0m8.929s user 0m5.606s sys 0m2.913s | ||
``` | ||
|
||
```bash | ||
pnpm i babel-preset-es2015 browserify chalk debug minimist mkdirp | ||
real 0m12.998s user 0m8.653s sys 0m3.362s | ||
``` | ||
|
||
```bash | ||
npm i babel-preset-es2015 browserify chalk debug minimist mkdirp | ||
real 1m4.729s user 0m55.589s sys 0m23.135s | ||
``` | ||
|
||
## License | ||
|
||
[MIT](LICENSE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* Copyright(c) cnpm and other contributors. | ||
* MIT Licensed | ||
* | ||
* Authors: | ||
* fengmk2 <[email protected]> (http://fengmk2.com) | ||
*/ | ||
|
||
'use strict'; | ||
|
||
/** | ||
* Module dependencies. | ||
*/ | ||
|
||
const chalk = require('chalk'); | ||
const runScript = require('./utils').runScript; | ||
|
||
module.exports = prepublish; | ||
|
||
// @see https://docs.npmjs.com/misc/scripts | ||
// Run BEFORE the package is published. (Also run on local npm install without any arguments.) | ||
function* prepublish(pkg, root, options) { | ||
const scripts = pkg.scripts || {}; | ||
if (scripts.prepublish) { | ||
options.console.warn(chalk.yellow('[%s@%s] scripts.prepublish: %j'), | ||
pkg.name, pkg.version, scripts.prepublish); | ||
yield runScript(root, scripts.prepublish, options); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters