I started converting simple things into the cool new Babel/ES6/ES2015. Turns out that a lot of the new features are very much half-assed.
Let's use export syntax to replicate:
module.exports = function () {};
CXX(target) Release/obj.target/bignum/bignum.o | |
In file included from ../bignum.cc:8: | |
In file included from ../../nan/nan.h:74: | |
In file included from ../../nan/nan_new.h:190: | |
../../nan/nan_implementation_12_inl.h:181:66: error: too many arguments to function call, expected at most 2, have 4 | |
return v8::Signature::New(v8::Isolate::GetCurrent(), receiver, argc, argv); | |
~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~ | |
/Users/aleksey/.node-gyp/5.3.0/include/node/v8.h:4674:3: note: 'New' declared here | |
static Local<Signature> New( |
Searching 1282 files for "pulseTillDone\(" (regex) | |
/Users/aleksey/.nvm/v0.10.32/lib/node_modules/npm/lib/fetch-package-metadata.js: | |
109 pickVersionFromRegistryDocument(clone(regCache[url])) | |
110 } else { | |
111: npm.registry.get(url, {auth: auth}, pulseTillDone('fetchMetadata', iferr(next, pickVersionFromRegistryDocument))) | |
112 } | |
113 function returnAndAddMetadata (pkg) { | |
/Users/aleksey/.nvm/v0.10.32/lib/node_modules/npm/lib/cache/add-named.js: |
{ | |
"typeId": "CPU", | |
"uid": 1, | |
"title": "Profile 1", | |
"head": { | |
"functionName": "(root)", | |
"url": "", | |
"lineNumber": 0, | |
"callUID": 1437, | |
"bailoutReason": "", |
All of the npm packages (May 7, 2015)
# Get all of the NPM metadata (82M file)!
curl -s -H "Transfer-Encoding: chunked" http://registry.npmjs.org/-/all > all.json
# Get all of the package names (155k of them)!
jq 'map(.name)' all.json > allnpm.json
# There are 171 case-insensitive repeating package names:
// Original Source: | |
// #include <stdio.h> | |
// | |
// int main(int argc, char **argv) { | |
// printf("Hello World\n"); | |
// return 0; | |
// } | |
// | |
var Module; |
var request = require('request') | |
, JSONStream = require('JSONStream') | |
, es = require('event-stream') | |
var req = request({url: 'http://isaacs.couchone.com/registry/_all_docs'}); | |
var parse = JSONStream.parse('rows.*'); | |
var map = es.map(function (data) { | |
// console.log(data); | |
return data; | |
}); |
var fs = require('fs'); | |
var stream = require('stream'); | |
var ts = new stream.Transform(); | |
ts._transform = function(chunk, enc, cb) { | |
// 'chunk' is the data from the readable source | |
// | |
// 'this.push(whatever)' or callback(err, whatever) writes | |
// to target writeable |
// Works (console.logs the headers) | |
require('http').request('http://www.google.com') | |
.on('response', function (response) { | |
console.log(response.headers); | |
}) | |
.end(); | |
// Doesn't work (hangs) | |
require('http').request('http://www.google.com') | |
.on('response', function (response) { |