This file contains hidden or 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
| (libuv) Failed to create kqueue (24) | |
| (libuv) Failed to create kqueue (24) | |
| events.js:72 | |
| throw er; // Unhandled 'error' event | |
| ^ | |
| Error: write EBADF | |
| at errnoException (net.js:905:11) | |
| at WriteStream.Socket._write (net.js:646:26) | |
| at doWrite (_stream_writable.js:226:10) |
This file contains hidden or 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
| var files = ['foo.js', 'bar.js', 'foo.js'] | |
| files.forEach(function (file) { | |
| // this will end up reading foo.js twice | |
| fs.readFile(file, function (err, data) { | |
| // ... | |
| }) | |
| }) |
This file contains hidden or 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
| var assert = require('assert') | |
| var callsites = require('error-callsites') | |
| var MyCustomError = require('error-create')('MyCustomError') | |
| var err = new MyCustomError('foo') | |
| assert(err instanceof Error) | |
| assert(err instanceof MyCustomError) | |
| assert.doesNotThrow(function () { | |
| callsites(err) |
This file contains hidden or 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
| [ | |
| "😁", | |
| "😂", | |
| "😃", | |
| "😄", | |
| "😅", | |
| "😆", | |
| "😉", | |
| "😊", | |
| "😋", |
This file contains hidden or 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
| // for more info about ReDoS, see: | |
| // https://en.wikipedia.org/wiki/ReDoS | |
| var r = /([a-z]+)+$/ | |
| var s = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaa!' | |
| console.log('Running regular expression... please wait') | |
| console.time('benchmark') | |
| r.test(s) |
This file contains hidden or 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
| var request = require('request') | |
| var JSONStream = require('JSONStream') | |
| var opts = { | |
| url: 'https://api.github.com/users/watson/repos', | |
| headers: {'User-Agent': 'request'} | |
| } | |
| request(opts) | |
| .pipe(JSONStream.parse('*')) |
This file contains hidden or 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
| var util = require('util') | |
| util.inherits(NotFoundError, Error) | |
| throw new NotFoundError('foo') | |
| function NotFoundError (message) { | |
| Error.captureStackTrace(this, this.constructor) | |
| this.name = this.constructor.name | |
| this.message = message |
This file contains hidden or 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' | |
| var ChangesStream = require('changes-stream') | |
| var block = 0 | |
| var biggest = 0 | |
| var changes = new ChangesStream({ | |
| db: 'https://replicate.npmjs.com', | |
| include_docs: true, |
This file contains hidden or 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
| { seq: 203248, | |
| id: 'testx2', | |
| changes: [ { rev: '1-53eafb13e023fc3a7a1b319a3eb17b2a' } ], | |
| doc: | |
| { _id: 'testx2', | |
| _rev: '1-53eafb13e023fc3a7a1b319a3eb17b2a', | |
| name: 'testx2', | |
| versions: | |
| { '1.0.0': | |
| { dist: { tarball: 'http://registry.npmjs.org/testx2/-/a' }, |
This file contains hidden or 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 bash | |
| # This script is an easy way to bisect between two releases of Node.js | |
| if [ $# -ne 2 ]; then | |
| echo "Error: No arguments supplied!" | |
| echo "Usage:" | |
| echo " ./bisect.sh <git-ref> <git-ref>" | |
| echo | |
| echo "Example:" |