Skip to content

Instantly share code, notes, and snippets.

View sidorares's full-sized avatar

Andrey Sidorov sidorares

View GitHub Profile
@max-mapper
max-mapper / readme.md
Last active October 30, 2015 03:05
node.js release questions

As a maintainer of native node add-on modules I have some questions about when and why NODE_MODULE_VERSION changes:

(@rvagg has anwered these in the comments below)

@princejwesley
princejwesley / await-babel-repl.js
Last active January 9, 2021 09:20
REPL with standalone await + babel transform
const repl = require('repl');
const babel = require('babel-core');
function preprocess(input) {
const awaitMatcher = /^(?:\s*(?:(?:let|var|const)\s)?\s*([^=]+)=\s*|^\s*)(await\s[\s\S]*)/;
const asyncWrapper = (code, binder) => {
let assign = binder ? `global.${binder} = ` : '';
return `(function(){ async function _wrap() { return ${assign}${code} } return _wrap();})()`;
};