-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
79 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
npm-edit(1) -- Edit an installed package | ||
======================================== | ||
|
||
## SYNOPSIS | ||
|
||
npm edit <pkg>[@<version>] | ||
|
||
## DESCRIPTION | ||
|
||
Opens the package folder in the default editor (or whatever you've | ||
configured as the npm `editor` config -- see `npm help config`.) | ||
|
||
After it has been edited, the package is rebuilt so as to pick up any | ||
changes in compiled packages. | ||
|
||
Note: If you're finding yourself using this a lot, it's probably better | ||
to use `npm link` instead. However, it is extremely handy when used in | ||
conjunction with `npm bundle`. | ||
|
||
For instance, you can do `npm bundle install connect` to install connect | ||
into your package, and then `npm bundle edit connect` to make a few | ||
changes to your locally bundled copy. |
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,24 @@ | ||
// npm edit <pkg>[@<version>] | ||
// open the package folder in the $EDITOR | ||
|
||
module.exports = edit | ||
edit.usage = "npm edit <pkg>[@<version>]" | ||
|
||
var npm = require("../npm") | ||
, exec = require("./utils/exec") | ||
, path = require("path") | ||
|
||
function edit (args, cb) { | ||
var p = args[0] | ||
p = p.split("@") | ||
if (args.length !== 1 || !p) return cb(edit.usage) | ||
var editor = npm.config.get("editor") | ||
, n = p.shift() | ||
, v = p.join("@") || "active" | ||
if (!editor) return cb(new Error( | ||
"No editor set. Set the 'editor' config, or $EDITOR environ.")) | ||
exec(editor, [path.join(npm.dir, n, v, "package")], function (er) { | ||
if (er) return cb(er) | ||
npm.commands.rebuild(args, cb) | ||
}) | ||
} |
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,32 @@ | ||
.\" Generated with Ronnjs/v0.1 | ||
.\" http://github.com/kapouer/ronnjs/ | ||
. | ||
.TH "NPM\-EDIT" "1" "November 2010" "" "" | ||
. | ||
.SH "NAME" | ||
\fBnpm-edit\fR \-\- Edit an installed package | ||
. | ||
.SH "SYNOPSIS" | ||
. | ||
.nf | ||
npm edit <pkg>[@<version>] | ||
. | ||
.fi | ||
. | ||
.SH "DESCRIPTION" | ||
Opens the package folder in the default editor (or whatever you\'ve | ||
configured as the npm \fBeditor\fR config \-\- see \fBnpm help config\fR\|\.) | ||
. | ||
.P | ||
After it has been edited, the package is rebuilt so as to pick up any | ||
changes in compiled packages\. | ||
. | ||
.P | ||
Note: If you\'re finding yourself using this a lot, it\'s probably better | ||
to use \fBnpm link\fR instead\. However, it is extremely handy when used in | ||
conjunction with \fBnpm bundle\fR\|\. | ||
. | ||
.P | ||
For instance, you can do \fBnpm bundle install connect\fR to install connect | ||
into your package, and then \fBnpm bundle edit connect\fR to make a few | ||
changes to your locally bundled copy\. |
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