- GitHub Staff
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
const handler = { | |
get: function (target, prop, receiver) { | |
if (typeof target[prop] !== 'function' ) { | |
return target[prop] | |
} | |
return function () { | |
return new Promise((resolve, reject) => { | |
Reflect.get(target, prop, receiver).apply(target, [...arguments, function (err, result) { | |
if (err) { | |
return reject(err) |
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
'use strict' | |
const fs = require('fs') | |
const words = fs.readFileSync('/usr/share/dict/words', 'utf8').split('\n') | |
const passwords = [] | |
for (let i = 0; i < 12; i++) { | |
const randomNumber = Math.floor(Math.random() * words.length) | |
passwords.push(words[randomNumber]) | |
} | |
console.log(passwords.join('-')) |
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
npm event lifecycle | |
cache add | |
- prepare (pacote.tarball.stream @npmcli/run-script) | |
ci | |
- preinstall (@npmcli/run-script) | |
- install (@npmcli/run-script) | |
- postinstall (@npmcli/run-script) | |
- prepublish (@npmcli/run-script) | |
- preprepare (@npmcli/run-script) |
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
version 9 subchunk with only one block? | |
09 01 04 | |
[] sub_chunk_version = 9 | |
[] num_storages = 1 | |
[] sub_chunk_index = 4 | |
00 00 | |
!! !! two empty bytes !! | |
nbt | |
0a 00 00 08 04 00 6e616d65 13006d696e6563726166743a73... (nbt continues) |
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
// https://docs.github.com/en/graphql/overview/explorer |
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
query { | |
search (query: "org:npm topic:npm-cli", type: REPOSITORY, first:100) { | |
nodes { | |
... on Repository { | |
nameWithOwner | |
pullRequests (labels: ["autorelease: pending"], first:100, states: [OPEN]) { | |
nodes { | |
number | |
url | |
title |
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
'use strict' | |
const pacote = require('pacote') | |
const fetch = require('npm-registry-fetch') | |
const semver = require('semver') | |
const perRequest = 10 | |
async function main() { | |
const manifest = await pacote.manifest(process.argv[2]) |
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
#!/usr/bin/env node | |
const pkg = require('./package.json') | |
console.log(`Hi there! I am ${pkg.name} version ${pkg.version}`) |
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
console.log(require('./package.json')) |
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
> pick = require('npm-pick-manifest') | |
[Function (anonymous)] | |
> packument | |
{ | |
name: 'some-package', | |
'dist-tags': { foo: '1.0.1' }, | |
versions: { | |
'1.0.0': { version: '1.0.0' }, | |
'1.0.1': { version: '1.0.1' }, | |
'1.0.2': { version: '1.0.2' }, |