Skip to content

Instantly share code, notes, and snippets.

🔮
the only way out is through

isaacs isaacs

🔮
the only way out is through
Block or report user

Report or block isaacs

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:ce4cc8e5ed0ecc99e490a23c3b95702e
diff --git a/lib/ci.js b/lib/ci.js
index 309ad2f78..a0df3b86f 100644
--- a/lib/ci.js
+++ b/lib/ci.js
@@ -4,6 +4,7 @@ const npm = require('./npm.js')
const Installer = require('libcipm')
const log = require('npmlog')
const path = require('path')
+const pack = require('./pack.js')
View -Users-isaacs-.vimrc
" Specify a directory for plugins
call plug#begin('~/.vim/plugged')
Plug 'tpope/vim-sensible'
Plug 'pangloss/vim-javascript'
Plug 'mxw/vim-jsx'
call plug#end()
set nu
set encoding=utf-8
let mapleader=","
View gist:d6e2ce17fe916c68a72427bce6de0720
diff --git a/lib/ci.js b/lib/ci.js
index 309ad2f78..a0df3b86f 100644
--- a/lib/ci.js
+++ b/lib/ci.js
@@ -4,6 +4,7 @@ const npm = require('./npm.js')
const Installer = require('libcipm')
const log = require('npmlog')
const path = require('path')
+const pack = require('./pack.js')
View gist:7ee366e3b1f9d87463ae93270f935410
diff --git a/test/tap/outdated-depth.js b/test/tap/outdated-depth.js
index 5cf7c7eda..c3d87c64c 100644
--- a/test/tap/outdated-depth.js
+++ b/test/tap/outdated-depth.js
@@ -47,6 +47,7 @@ test('outdated depth zero', function (t) {
mr({ port: common.port }, function (er, s) {
npm.load(
{
+ depth: 0,
loglevel: 'silent',
View weird-cb-not-called-should-be-handled-test.js
const fs = require('fs')
if (process.argv[2] === 'install') {
const eacces = (path, dest) => {
const er = new Error('EACCES: I can\'t go for that')
er.path = path
er.dest = dest
er.code = 'EACCES'
er.syscall = 'rename'
er.errno = -13
View gist:826822befc8cd6de8280faf75c9fe230
diff --git a/index.js b/index.js
index d9a8373..d5eb76a 100644
--- a/index.js
+++ b/index.js
@@ -97,6 +97,13 @@ function pickManifest (packument, wanted, opts) {
target &&
packument.versions[target]
)
+
+ // // check packument.restrictedByPolicy[target] ...
View gist:aad0efaf5fee9e698ffd15452132e680
Find the best place to add a node, given the current state of the tree,
the constraints of the node being added, and the place where it is
going to be added.
Given an npa request, resolve it to either a single object (like a folder,
url, or git repo) or a range of manifests (a range of versions), or a
specific version (pinned or dist-tag)
1. Resolve any peer deps that each node has (to a range or single object)
2. Available options are R(all versions in range) x P(all peer deps in each)
View gist:5ab2523ec09488dcb11b86968050b9f3
diff --git a/index.js b/index.js
index b2a25ee..b34ae25 100644
--- a/index.js
+++ b/index.js
@@ -21,19 +21,14 @@ const resolveFrom = require('resolve-from')
const DEFAULT_NODE_GYP_PATH = resolveFrom(__dirname, 'node-gyp/bin/node-gyp')
const hookStatCache = new Map()
-let PATH = 'PATH'
+let PATH = isWindows ? 'Path' : 'PATH'
View failback-parse-error.js
var name = 'foo\\\\-bar'
var failbackExpr = /(\\*)-/g
var failbackMatch
var failback
while ((failbackMatch = failbackExpr.exec(name))) {
esc = failbackMatch[1]
esc = esc.length && esc.length % 2
if (esc) continue
failback = name.slice(failbackMatch.index + 1)
name = name.slice(0, failbackMatch.index)
View test.js
const tar = require('tar')
const {writeFileSync} = require('fs')
const {resolve} = require('path')
const {spawnSync} = require('child_process')
const mkdirp = require('mkdirp')
const $ = (...args) => {
const res = spawnSync('tar', args, { stdio: [0, 1, 2 ] }).status
console.log(res ? `ERROR=${res}` : 'OK')
}
You can’t perform that action at this time.