Skip to content

Instantly share code, notes, and snippets.

View mflorence99's full-sized avatar
⛷️
New knee is rock solid!

Mark Florence mflorence99

⛷️
New knee is rock solid!
View GitHub Profile
@vkz
vkz / escodegen-comments.js
Last active February 6, 2023 17:54
Preserve comments with Esprima + Escodegen combination
// escodegen has a fucked up API for attaching comments
// https://github.com/estools/escodegen/issues/10
var esprima = require("esprima");
var es = require("escodegen");
var ast = esprima.parse(
'//comment here\nvar answer = 42;',
{range: true, tokens: true, comment: true});
// attaching comments is a separate step
@peteroupc
peteroupc / LineReader.js
Last active November 22, 2022 04:05
JavaScript class for reading files line by line in HTML5 apps
/*
Written by Peter O.
Any copyright to this work is released to the Public Domain.
In case this is not possible, this work is also
licensed under Creative Commons Zero (CC0):
https://creativecommons.org/publicdomain/zero/1.0/
*/