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:62a2ecabfd2199232db64fb6c56bacb5
diff --git a/index.js b/index.js
index f17d484..c30c2cd 100644
--- a/index.js
+++ b/index.js
@@ -347,7 +347,7 @@ module.exports.checkData = checkData
function checkData (data, sri, opts) {
opts = ssriOpts(opts)
sri = parse(sri, opts)
- if (!Object.keys(sri).length) {
+ if (!sri || !Object.keys(sri).length) {
View lib-utils-defig.js
// XXX REMOVE THIS WHEN FIGGY PUDDING IS GONE
const figgy = require('figgy-pudding')
const DeFiggy = figgy({}, {
other: () => true
})
module.exports = conf => DeFiggy(conf).toJSON()
View README.md
  1. Add a Workspace class (subclass of Node) in Arborist
  2. all packages in workspace get symlinked to workspace ./node_modules
  3. app packages in ws get deps symlinked to ws ./node_modules if present
  4. deps are hoisted, possibly to ws root, and if so, symlinked to package/nm
  5. nested workspaces get the ws deps from ws parent if possible
  6. if a package is a part of 2 workspaces simultaneously, it's a footgun (or is it?) -- ok to just skip any nested workspace packages that are already included in a root workspace, and vice versa. churn is not so bad, and unavoidable.
View config.md

// Configs defined as npm config fields

//registry.npmjs.org/:_authToken=<uuid> the auth token to send to the registry. Not sure what this should look like on the conf object?

// scoped registries @npm:registry = "https://registry.internal.npmjs.com/"

metrics-registry => metricsRegistry

View config.md

// Configs defined as npm config fields

//registry.npmjs.org/:_authToken=<uuid> the auth token to send to the registry. Not sure what this should look like on the conf object?

metrics-registry => metricsRegistry send-metrics = false registry = "https://registry.npmjs.org/" scope user-agent userAgent

View n.js
const nock = require('nock')
const server = nock('http://localhost:8080')
const CONTENT = 'this is fine'
server
.get('/test')
.times(1)
.reply(200, CONTENT)
View n.js
const nock = require('nock')
const server = nock('http://localhost')
const CONTENT = 'this is fine'
server
.get('/test')
.times(1)
.reply(200, CONTENT)
@isaacs
isaacs / npm-v6-no-node_modules-no-lockfile.txt
Created Feb 5, 2020
Preliminary timing of npm v6 vs Arborist (ie, npm v7) in a few scenarios.
View npm-v6-no-node_modules-no-lockfile.txt
$ npm i
npm WARN deprecated core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated @types/vfile-message@2.0.0: This is a stub types definition. vfile-message provides its own type definitions, so you do not need this installed.
npm WARN deprecated core-js@1.2.7: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
> fsevents@1.2.11 install /Users/isaacs/dev/blog.izs.me/node_modules/fsevents
> node-gyp rebuild
SOLINK_MODULE(target) Release/.node
CXX(target) Release/obj.target/fse/fsevents.o
View notes-pnpm.md

pnpm notes

pnpm arranges the tree like this:

root
+-- node_modules
    +-- .pnpm
    |   +-- lock.yaml
    |   +-- registry.npmjs.org
View gist:60883a70fcf5ccae9a1ed608b789c13f
dist: {
integrity: 'sha512-rCChFkLK9aqmk34ewjVmoUL3MD0yxzj3xkknS7MtDO5rx5z4d4bB+GxsAu4zoYc9r3ynQyEfc2GNtpL94yZaEw==',
shasum: 'd16d26468bd9433f6d803a76d2832f9cb0721883',
tarball: 'https://registry.npmjs.org/pacote/-/pacote-10.3.1.tgz',
fileCount: 25,
unpackedSize: 69978,
'npm-signature': '-----BEGIN PGP SIGNATURE-----\r\n' +
'Version: OpenPGP.js v3.0.4\r\n' +
'Comment: https://openpgpjs.org\r\n' +
'\r\n' +
You can’t perform that action at this time.