Skip to content

Instantly share code, notes, and snippets.

@iarna
iarna / npm-symlinks.md
Created July 16, 2015 18:30
npm and symlinks
@iarna
iarna / README.md
Last active December 15, 2015 21:48
Console Capability Tests

These is a basic console capability test. Clone this repo (https://gist.github.com/58553b13c477de79069e.git) and use node cat console-test.txt to dump the test to your screen. (On Mac & Linux you can just use cat.) There's also a hide-cursor.txt and show-cursor.txt that should do what they say.

All of this is about me trying to figure out what actually is shared cross platform and what isn't.

What I've learned so far is:

Unhandled rejection TypeError: Cannot read property 'pipesCount' of undefined
at module.exports.Readable.pipe (_stream_readable.js:545:16)
at module.exports.ZipArchiveOutputStream._smartStream (/Users/rebecca/code/fetch-fic/node_modules/compress-commons/lib/archivers/zip/zip-archive-output-stream.js:184:11)
at module.exports.ZipArchiveOutputStream._appendBuffer (/Users/rebecca/code/fetch-fic/node_modules/compress-commons/lib/archivers/zip/zip-archive-output-stream.js:82:10)
at module.exports.ArchiveOutputStream.entry (/Users/rebecca/code/fetch-fic/node_modules/compress-commons/lib/archivers/archive-output-stream.js:86:10)
at module.exports.ZipStream.entry (/Users/rebecca/code/fetch-fic/node_modules/zip-stream/index.js:138:49)
at module.exports.tryCatcher (/Users/rebecca/code/fetch-fic/node_modules/bluebird/js/release/util.js:16:23)
at module.exports.ret [as entry] (eval at makeNodePromisifiedEval (/Users/rebecca/code/fetch-fic/node_modules/bluebird/js/release/promisify.js:184:12),
@iarna
iarna / index.js
Created September 21, 2017 21:46
instanceof checks, readable-stream and require-inject
const test = require('tap').test
const requireInject = require('require-inject')
const EventEmitter = require('events')
class NullSink extends EventEmitter {
write () {
return true
}
end () {
this.emit('prefinish')
@iarna
iarna / package-lock.json
Last active November 6, 2017 12:29
shrinkpack bug
{
"name": "x",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"whatwg-fetch": {
"version": "2.0.3",
"resolved": "file:whatwg-fetch-2.0.3.tar",
"integrity": "sha512-RFZv5NwmYdZP+xIWp6SZkF0kiBe6oG05+mlWRZNi+lTMM99NByWEtXoTjR8SLNS3FVJ0iy0Y3h44skNHlVvY4w=="
@iarna
iarna / README.md
Last active November 10, 2017 13:03
package-lock-only tests

made a folder called install-package-lock-only containing only a package.json with these contents:

{
  "name": "install-package-lock-only",
  "version": "1.0.0",
  "dependencies": {
    "mkdirp": "^0.3.4"
 }
// render thread
// index
// record indexes of natural line breaks
// record indexs of wrapped line breaks w/ predefined width
// display (line start, #lines, width)
const fs = require('fs')
let exampleText
let lineBreaks = []
@iarna
iarna / 1results.md
Last active May 6, 2019 19:22
Tar / Tar fs Benchmark