Skip to content

Commit

Permalink
Put .js on filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Aug 6, 2011
1 parent 9c0b248 commit 645cef3
Show file tree
Hide file tree
Showing 76 changed files with 286 additions and 284 deletions.
12 changes: 6 additions & 6 deletions lib/adduser.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

module.exports = adduser

var registry = require('./utils/npm-registry-client')
, ini = require("./utils/ini")
, log = require("./utils/log")
, npm = require("../npm")
, prompt = require("./utils/prompt")
, promiseChain = require("./utils/promise-chain")
var registry = require("./utils/npm-registry-client/index.js")
, ini = require("./utils/ini.js")
, log = require("./utils/log.js")
, npm = require("../npm.js")
, prompt = require("./utils/prompt.js")
, promiseChain = require("./utils/promise-chain.js")
, crypto

try {
Expand Down
4 changes: 2 additions & 2 deletions lib/bin.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = bin

var npm = require("../npm")
, output = require("./utils/output")
var npm = require("../npm.js")
, output = require("./utils/output.js")

bin.usage = "npm bin\nnpm bin -g\n(just prints the bin folder)"

Expand Down
12 changes: 6 additions & 6 deletions lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@

// This runs AFTER install or link are completed.

var npm = require("../npm")
, log = require("./utils/log")
var npm = require("../npm.js")
, log = require("./utils/log.js")
, chain = require("slide").chain
, fs = require("graceful-fs")
, path = require("path")
, lifecycle = require("./utils/lifecycle")
, readJson = require("./utils/read-json")
, link = require("./utils/link")
, lifecycle = require("./utils/lifecycle.js")
, readJson = require("./utils/read-json.js")
, link = require("./utils/link.js")
, linkIfExists = link.ifExists
, asyncMap = require("slide").asyncMap
, output = require("./utils/output")
, output = require("./utils/output.js")

module.exports = build
build.usage = "npm build <folder>\n(this is plumbing)"
Expand Down
26 changes: 13 additions & 13 deletions lib/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,25 @@ exports.read = read
exports.clean = clean
exports.unpack = unpack

var mkdir = require("./utils/mkdir-p")
, exec = require("./utils/exec")
, fetch = require("./utils/fetch")
, npm = require("../npm")
var mkdir = require("./utils/mkdir-p.js")
, exec = require("./utils/exec.js")
, fetch = require("./utils/fetch.js")
, npm = require("../npm.js")
, fs = require("graceful-fs")
, rm = require("./utils/rm-rf")
, readJson = require("./utils/read-json")
, registry = require("./utils/npm-registry-client")
, log = require("./utils/log")
, rm = require("./utils/rm-rf.js")
, readJson = require("./utils/read-json.js")
, registry = require("./utils/npm-registry-client/index.js")
, log = require("./utils/log.js")
, path = require("path")
, output
, sha = require("./utils/sha")
, find = require("./utils/find")
, sha = require("./utils/sha.js")
, find = require("./utils/find.js")
, asyncMap = require("slide").asyncMap
, semver = require("semver")
, tar = require("./utils/tar")
, tar = require("./utils/tar.js")
, FMODE = tar.FMODE
, DMODE = tar.DMODE
, fileCompletion = require("./utils/completion/file-completion")
, fileCompletion = require("./utils/completion/file-completion.js")
, url = require("url")

cache.usage = "npm cache add <tarball file>"
Expand Down Expand Up @@ -125,7 +125,7 @@ function read (name, ver, forceBypass, cb) {

// npm cache ls [<path>]
function ls (args, cb) {
output = output || require("./utils/output")
output = output || require("./utils/output.js")
args = args.join("/").split("@").join("/")
if (args.substr(-1) === "/") args = args.substr(0, args.length - 1)
ls_(args, npm.config.get("depth"), function(er, files) {
Expand Down
6 changes: 3 additions & 3 deletions lib/completion.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ completion.usage = "npm completion >> ~/.bashrc\n"
+ "npm completion >> ~/.zshrc\n"
+ "source <(npm completion)"

var output = require("./utils/output")
, configDefs = require("./utils/config-defs")
var output = require("./utils/output.js")
, configDefs = require("./utils/config-defs.js")
, configTypes = configDefs.types
, shorthands = configDefs.shorthands
, nopt = require("nopt")
Expand All @@ -16,7 +16,7 @@ var output = require("./utils/output")
, shorthandNames = Object.keys(shorthands)
, allConfs = configNames.concat(shorthandNames)
, stdio = process.binding("stdio")
, npm = require("../npm")
, npm = require("../npm.js")

completion.completion = function (opts, cb) {
if (opts.w > 3) return cb()
Expand Down
14 changes: 7 additions & 7 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ config.usage = "npm config set <key> <value>"
+ "\nnpm config list"
+ "\nnpm config edit"

var ini = require("./utils/ini")
, log = require("./utils/log")
, npm = require("../npm")
, exec = require("./utils/exec")
var ini = require("./utils/ini.js")
, log = require("./utils/log.js")
, npm = require("../npm.js")
, exec = require("./utils/exec.js")
, fs = require("graceful-fs")
, dc
, output = require("./utils/output")
, types = require("./utils/config-defs").types
, output = require("./utils/output.js")
, types = require("./utils/config-defs.js").types

config.completion = function (opts, cb) {
var argv = opts.conf.argv.remain
Expand Down Expand Up @@ -65,7 +65,7 @@ function edit (cb) {
if (er) return cb(er)
fs.readFile(f, "utf8", function (er, data) {
if (er) data = ""
dc = dc || require("./utils/config-defs").defaults
dc = dc || require("./utils/config-defs.js").defaults
data = [ ";;;;"
, "; npm "+(ini.get("global") ? "globalconfig" : "userconfig")+" file"
, "; this is a simple ini-formatted file"
Expand Down
6 changes: 3 additions & 3 deletions lib/deprecate.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ deprecate.completion = function (opts, cb) {
})
}

var registry = require("./utils/npm-registry-client")
var registry = require("./utils/npm-registry-client/index.js")
, semver = require("semver")
, log = require("./utils/log")
, npm = require("../npm")
, log = require("./utils/log.js")
, npm = require("../npm.js")

function deprecate (args, cb) {
var pkg = args[0]
Expand Down
9 changes: 5 additions & 4 deletions lib/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ docs.completion = function (opts, cb) {
})
}

var exec = require("./utils/exec")
, registry = require("./utils/npm-registry-client")
, npm = require("../npm")
, log = require("./utils/log")
var exec = require("./utils/exec.js")
, registry = require("./utils/npm-registry-client/index.js")
, npm = require("../npm.js")
, log = require("./utils/log.js")

function docs (args, cb) {
if (!args.length) return cb(docs.usage)
var n = args[0].split("@").shift()
Expand Down
8 changes: 4 additions & 4 deletions lib/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
module.exports = edit
edit.usage = "npm edit <pkg>"

edit.completion = require("./utils/completion/installed-shallow")
edit.completion = require("./utils/completion/installed-shallow.js")

var npm = require("../npm")
, exec = require("./utils/exec")
var npm = require("../npm.js")
, exec = require("./utils/exec.js")
, path = require("path")
, fs = require("graceful-fs")
, log = require("./utils/log")
, log = require("./utils/log.js")

function edit (args, cb) {
var p = args[0]
Expand Down
6 changes: 3 additions & 3 deletions lib/explore.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

module.exports = explore
explore.usage = "npm explore <pkg> [ -- <cmd>]"
explore.completion = require("./utils/completion/installed-shallow")
explore.completion = require("./utils/completion/installed-shallow.js")

var npm = require("../npm")
, exec = require("./utils/exec")
var npm = require("../npm.js")
, exec = require("./utils/exec.js")
, path = require("path")
, fs = require("graceful-fs")

Expand Down
2 changes: 1 addition & 1 deletion lib/faq.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ module.exports = faq

faq.usage = "npm faq"

var npm = require("../npm")
var npm = require("../npm.js")

function faq (args, cb) { npm.commands.help(["faq"], cb) }
2 changes: 1 addition & 1 deletion lib/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = get

get.usage = "npm get <key> <value> (See `npm config`)"

var npm = require("../npm")
var npm = require("../npm.js")

get.completion = npm.commands.config.completion

Expand Down
6 changes: 3 additions & 3 deletions lib/help-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
module.exports = helpSearch

var fs = require("graceful-fs")
, output = require("./utils/output")
, output = require("./utils/output.js")
, path = require("path")
, asyncMap = require("slide").asyncMap
, docsPath = path.join(__dirname, "..", "doc")
, log = require("./utils/log")
, npm = require("../npm")
, log = require("./utils/log.js")
, npm = require("../npm.js")

helpSearch.usage = "npm help-search <text>"

Expand Down
6 changes: 3 additions & 3 deletions lib/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ help.completion = function (opts, cb) {

var fs = require("graceful-fs")
, path = require("path")
, exec = require("./utils/exec")
, npm = require("../npm")
, output = require("./utils/output")
, exec = require("./utils/exec.js")
, npm = require("../npm.js")
, output = require("./utils/output.js")

function help (args, cb) {
if (args.length > 1 && args[0]) return npm.commands["help-search"](args, cb)
Expand Down
14 changes: 7 additions & 7 deletions lib/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@

module.exports = init

var prompt = require("./utils/prompt")
var prompt = require("./utils/prompt.js")
, path = require("path")
, readJson = require("./utils/read-json")
, readJson = require("./utils/read-json.js")
, fs = require("graceful-fs")
, promiseChain = require("./utils/promise-chain")
, exec = require("./utils/exec")
, promiseChain = require("./utils/promise-chain.js")
, exec = require("./utils/exec.js")
, semver = require("semver")
, log = require("./utils/log")
, npm = require("../npm")
, output = require("./utils/output")
, log = require("./utils/log.js")
, npm = require("../npm.js")
, output = require("./utils/output.js")

init.usage = "npm init [folder]"

Expand Down
18 changes: 9 additions & 9 deletions lib/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ install.completion = function (opts, cb) {
// if it has a slash, then it's gotta be a folder
// if it starts with https?://, then just give up, because it's a url
// for now, not yet implemented.
var registry = require("./utils/npm-registry-client")
var registry = require("./utils/npm-registry-client/index.js")
registry.get("/-/short", function (er, pkgs) {
if (er) return cb()
if (!opts.partialWord) return cb(null, pkgs)
Expand All @@ -131,27 +131,27 @@ install.completion = function (opts, cb) {
})
}

var npm = require("../npm")
var npm = require("../npm.js")
, semver = require("semver")
, readJson = require("./utils/read-json")
, log = require("./utils/log")
, readJson = require("./utils/read-json.js")
, log = require("./utils/log.js")
, path = require("path")
, fs = require("graceful-fs")
, cache = require("./cache")
, cache = require("./cache.js")
, asyncMap = require("slide").asyncMap
, chain = require("slide").chain
, relativize = require("./utils/relativize")
, relativize = require("./utils/relativize.js")
, output
, url = require("url")
, mkdir = require("./utils/mkdir-p")
, lifecycle = require("./utils/lifecycle")
, mkdir = require("./utils/mkdir-p.js")
, lifecycle = require("./utils/lifecycle.js")

function install (args, cb_) {

function cb (er, installed) {
if (er) return cb_(er)

output = output || require("./utils/output")
output = output || require("./utils/output.js")

var tree = treeify(installed)
, pretty = prettify(tree, installed)
Expand Down
16 changes: 8 additions & 8 deletions lib/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
// link with no args: symlink the folder to the global location
// link with package arg: symlink the global to the local

var npm = require("../npm")
, symlink = require("./utils/link")
var npm = require("../npm.js")
, symlink = require("./utils/link.js")
, fs = require("graceful-fs")
, log = require("./utils/log")
, log = require("./utils/log.js")
, asyncMap = require("slide").asyncMap
, chain = require("slide").chain
, path = require("path")
, relativize = require("./utils/relativize")
, rm = require("./utils/rm-rf")
, output = require("./utils/output")
, build = require("./build")
, relativize = require("./utils/relativize.js")
, rm = require("./utils/rm-rf.js")
, output = require("./utils/output.js")
, build = require("./build.js")

module.exports = link

Expand Down Expand Up @@ -102,7 +102,7 @@ function linkInstall (pkgs, cb) {
function linkPkg (folder, cb_) {
var gp = npm.config.get("prefix")
, me = folder || npm.prefix
, readJson = require("./utils/read-json")
, readJson = require("./utils/read-json.js")
readJson( path.resolve(me, "package.json")
, { dev: true }
, function (er, d) {
Expand Down
10 changes: 5 additions & 5 deletions lib/ls.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

module.exports = exports = ls

var npm = require("../npm")
, readInstalled = require("./utils/read-installed")
, output = require("./utils/output")
, log = require("./utils/log")
, relativize = require("./utils/relativize")
var npm = require("../npm.js")
, readInstalled = require("./utils/read-installed.js")
, output = require("./utils/output.js")
, log = require("./utils/log.js")
, relativize = require("./utils/relativize.js")
, path = require("path")

ls.usage = "npm ls"
Expand Down
Loading

0 comments on commit 645cef3

Please sign in to comment.