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
declare namespace NodeJS { | |
interface Global { | |
'my-object': { | |
errlog?: string | |
debug?: boolean | |
context?: any | |
} | |
} | |
} |
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
import {Command} from '@oclif/command' | |
import axios from 'axios' | |
export default class Stars extends Command { | |
static description = 'show the github stars on a repository' | |
static args = [{name: 'repository', required: true}] | |
async run() { | |
const {args} = this.parse(Stars) | |
const {data: stargazers} = await axios.get(`https://api.github.com/repos/${args.repository}/stargazers`) | |
for (let s of stargazers) { |
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
protected parse<F, A extends {[name: string]: any}>(options: Parser.Input<F>, argv = this.argv): Parser.Output<F, A> { | |
const {flags, args, strict} = options | |
return require('@oclif/parser').parse(argv, {context: this, flags, args, strict}) | |
} |
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 fs = require('fs-extra'); | |
const path = require('path'); | |
const debug = require('debug')('rwlockfile'); | |
const mkdir = require('mkdirp'); | |
let locks = {}; | |
let readers = {}; | |
async function pidActive(pid) { | |
if (!pid || isNaN(pid)) return false; |
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 rwlockfile = require('./src/rwlockfile') | |
rwlockfile.read('foo') | |
console.log('unread foo in 10s') | |
setTimeout(() => { | |
console.log('unreading foo') | |
rwlockfile.unread('foo') | |
}, 10000) |
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
// ./package.json | |
{ | |
'cli-engine': { | |
events: { | |
preRun: './lib/events/pre_run.js' | |
} | |
} | |
} | |
// ./lib/events/before_run.js |
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
// flag.js | |
import { merge, type Flag } from 'cli-engine-command/lib/flags' | |
type Options = $Shape<Flag<boolean>> | |
export default function ResetFlag (options: Options = {}, env: typeof process.env = process.env): Flag<string> { | |
const defaultOptions: Options = { | |
char: 'r', | |
parse: (input, cmd) => { | |
if (options.required) throw new Error('you should have set --reset') | |
} |
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
Arguments: | |
/usr/local/bin/node /usr/local/bin/yarn | |
PATH: | |
./bin:./node_modules/.bin:/usr/local/opt/go/libexec/bin:/Users/dickeyxxx/bin:/usr/local/bin:/usr/local/sbin:./bin:./node_modules/.bin:/usr/local/opt/go/libexec/bin:/Users/dickeyxxx/bin:/usr/local/bin:/usr/local/sbin:./bin:./node_modules/.bin:/usr/local/opt/go/libexec/bin:/Users/dickeyxxx/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/Users/dickeyxxx/.config/yarn/global/node_modules/.bin:/Users/dickeyxxx/.cargo/bin:/usr/local/bin:/Users/dickeyxxx/.config/yarn/global/node_modules/.bin:/Users/dickeyxxx/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/usr/local/bin:/Users/dickeyxxx/.config/yarn/global/node_modules/.bin:/Users/dickeyxxx/.cargo/bin | |
Yarn version: | |
0.27.5 | |
Node 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
Arguments: | |
/usr/local/bin/node /usr/local/bin/yarn add file:./test/heroku-debug/5.0.3 | |
PATH: | |
./bin:./node_modules/.bin:/usr/local/opt/go/libexec/bin:/Users/dickeyxxx/bin:/usr/local/bin:/usr/local/sbin:./bin:./node_modules/.bin:/usr/local/opt/go/libexec/bin:/Users/dickeyxxx/bin:/usr/local/bin:/usr/local/sbin:./bin:./node_modules/.bin:/usr/local/opt/go/libexec/bin:/Users/dickeyxxx/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/Users/dickeyxxx/.config/yarn/global/node_modules/.bin:/Users/dickeyxxx/.cargo/bin:/usr/local/bin:/Users/dickeyxxx/.config/yarn/global/node_modules/.bin:/Users/dickeyxxx/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/usr/local/bin:/Users/dickeyxxx/.config/yarn/global/node_modules/.bin:/Users/dickeyxxx/.cargo/bin | |
Yarn version: | |
0.27.5 | |
Node 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
require 'language/node' | |
class Heroku < Formula | |
desc "Command-line client for the cloud PaaS" | |
homepage "https://cli.heroku.com" | |
url "https://registry.npmjs.org/heroku-cli/-/heroku-cli-6.11.17.tgz" | |
version "6.11.17" | |
sha256 "3242779e9103706c3264d6919aed20b20068d21048b12a6b9179564da631ecf1" | |
head "https://github.com/heroku/cli.git" |