Socket
Socket
Sign inDemoInstall

symlink

Package Overview
Dependencies
24
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 1.1.0

35

bin.js
#!/usr/bin/env node
var argv = require('optimist')
.usage('Usage: $0 repoDirs [-d] [-g globals]')
.describe('g', 'globally-link')
var argv = require('yargs')
.usage('Usage: symlink <repoDirs> [options]')
.demand(1)
.example('symlink ./repos')
.example('symlink ./repos -g coveralls -g nodeunit')
.alias('d', 'dry-run')
.describe('d', 'Print the commands to be executed and exit')
.boolean('d')
.describe('d', 'dry-run')
.demand(1)
.alias('g', 'global')
.describe('g', 'globally installed module to be linked')
.array('g') // NB: will be unset if not used (default strings are ugly)
.alias('h', 'help')
.help('h')
.argv;

@@ -15,10 +22,9 @@

});
// can do multiple -g globX chains
var globals = argv.g ? (Array.isArray(argv.g) ? argv.g : [argv.g]): []
var cp = require('child_process');
var async = require('async');
require('./')(dirs, globals, function (err, cmds) {
require('./')(dirs, argv.g || [], function (err, cmds) {
if (err) {
throw err;
console.error(err.message);
process.exit(1);
}

@@ -36,5 +42,2 @@

console.log(stdout);
if (error !== null) {
console.log('exec error: ' + error);
}
cb(error);

@@ -46,4 +49,10 @@ });

// exec commands synchronously
async.series(execs);
async.series(execs, function (err) {
if (err) {
console.error(err.message);
process.exit(1);
}
process.exit(0);
});
}
});

@@ -0,1 +1,6 @@

1.1.0 / 2015-03-28
==================
* Swap optimist for yargs and improve command line usage
* Errors from child_process calls in CLI now result in non-zero return code
1.0.1 / 2015-03-28

@@ -2,0 +7,0 @@ ==================

@@ -5,3 +5,3 @@ {

"author": "Eirik Albrigtsen <analsandblaster@gmail.com>",
"version": "1.0.1",
"version": "1.1.0",
"repository": {

@@ -29,3 +29,3 @@ "type": "git",

"interlude": "~1.1.0",
"optimist": "~0.6.0"
"yargs": "^3.6.0"
},

@@ -32,0 +32,0 @@ "devDependencies": {

@@ -14,7 +14,7 @@ # symlink

## Usage
Install, then run in the directory containing all your repos that youd like to link together (will take all folders that contain a package.json)
Install, then give it a set of directories containing packages that you would like to link together (will take all subfolders that contain a package.json).
```bash
npm install -g symlink
symlink repoDir1 repoDir2 ..
symlink repoDir --dry-run
```

@@ -24,5 +24,5 @@

- reads the `package.json` of each module founds in the repo dirs and collects their `dependencies` and `devDependencies`
- figures out which deps are local to `repoDir`
- figures out which deps are external
- reads the `package.json` of each module founds in the given directory and collects their `dependencies` and `devDependencies`
- figures out which deps are local (in one of the repoDirs)
- figures out which deps are external (complement)
- orders the modules so that linking can be in a safe order without having to query npmjs.org more than necessary

@@ -32,7 +32,7 @@

- `npm link ((globals ∩ externalDeps) ∪ (localDeps))`
- `npm link (localDeps) ∪ ((globals ∩ externalDeps))`
- `npm install (externalDeps ∖ globals)`
- `npm link`
I.e. link in all globally installed modules that were specified explicitly and the locally available dependencies in the directories, install the rest, then link the module itself so the modules with more inclusions can safely link the module in.
I.e. link in all locally available dependencies + extenal globals that were requested explicitly, install the rest, then link the module itself so the modules with more inclusions can safely link the module in.

@@ -44,3 +44,3 @@ ## Example

# NB: for readability the full paths have been shortened
kjttks@clux ~/repos $ symlink . -g tap -d
kjttks@clux ~/repos $ symlink . --global tap --dry-run
[

@@ -121,3 +121,3 @@ "cd ./blog && npm install marked ecstatic promzard async browserify ejs",

Without the dry-run `-d` flag, these commands would be executed sequentially in this order.
Without the dry-run flag, these commands would be executed sequentially in this order.

@@ -131,6 +131,3 @@ The most independent modules gets their missing dependencies installed first, then gets npm linked so the more requiring modules can npm link in these.

## Try before you buy
After cloning a bunch of node git repos, you can see how it would link these together first by running symlink with the dry-run `-d` flag.
## License
MIT-Licensed. See LICENSE file for details.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc