Skip to content

Instantly share code, notes, and snippets.

/**
* Usage:
*
* node -r this_file.js module_to_load.js
*/
'use strict';
var path = require('path');
var Module = require('module').Module;
var _load = Module._load;
@zertosh
zertosh / .babelrc
Last active October 26, 2016 15:42
v8-generator-bug
{
"plugins": [
"transform-async-to-generator",
"transform-strict-mode"
]
}
@zertosh
zertosh / original.js
Created October 26, 2016 00:35
Atom 1.12.0-beta4 with --harmony "TypeError: Generator is already running"
function bar() {
return 1;
}
async function foo() {
let out = await bar();
return out.toString();
}
foo();
#!/usr/bin/env node
'use strict';
// npm install stats-lite
// export PATH="/System/Library/Frameworks/JavaScriptCore.framework/Versions/Current/Resources:$PATH"
// ./node_modules/.bin/grunt build
// node load-benchmark.js
const {spawnSync} = require('child_process');
const stats = require('stats-lite');
@zertosh
zertosh / .gitignore
Last active April 24, 2016 00:22
time rx load times
.DS_Store
/node_modules
@zertosh
zertosh / .flowconfig
Created January 28, 2016 22:32
react-dom-server-flow-fix
[include]
[ignore]
.*/node_modules/react/.*
.*/node_modules/react-dom/.*
[libs]
./react-flow.js
[options]
@zertosh
zertosh / README.md
Last active September 30, 2016 15:39
solution - super() not calling parent's constructor on IE9 - https://github.com/babel/babelify/issues/133

babel/babelify#133

For super calls to work in IE9, you must enable "loose" mode for the class transform. For inherited static properties to work in IE9, you must also add the babel-plugin-transform-proto-to-assign plugin.

./node_modules/.bin/browserify -t [ babelify --plugins [ transform-flow-strip-types ] ] entry.js
@zertosh
zertosh / .gitignore
Last active November 11, 2015 04:45
watchify-label
/node_modules
@zertosh
zertosh / example.js
Created November 8, 2015 03:15
duplexer2 example for node 4.x
#!/usr/bin/env node
"use strict";
const stream = require("readable-stream");
const duplexer2 = require("duplexer2");
const writable = new class extends stream.Writable {
constructor() {