Skip to content

Instantly share code, notes, and snippets.

@jhliberty
Forked from eirikb/example.js
Last active August 29, 2015 14:17
Show Gist options
  • Save jhliberty/d61e6b182af6758ad06b to your computer and use it in GitHub Desktop.
Save jhliberty/d61e6b182af6758ad06b to your computer and use it in GitHub Desktop.
var nodify = require('nodify');
// Prints build time
console.log(nodify(function() {
return new Date();
}));
// Prints current time
console.log(new Date());
var built = new Date(nodify(function () {
return Date.now();
}));
var builtBy = nodify(function (require) {
var parts = process.env['USERPROFILE'].split(require('path').sep);
return ('' + parts[parts.length - 1]).trim().toLowerCase();
});
// ...
bundler.transform('nodify');
// ...
var staticModule = require('static-module');
module.exports = function () {
return staticModule({
nodify: function (cb) {
return "JSON.parse('" + JSON.stringify(cb(require)) + "')";
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment