0.0.2 • Published 11 years ago

setflags v0.0.2

Weekly downloads
29
License
-
Repository
github
Last release
11 years ago

setflags

Set v8 command line flags at runtime, which would theoretically let you enable harmony features at runtime.

setFlags(args)

Either a string or an array of strings as if you had passed them on the command line to node.

harmonyRequire(module, args)

Allows you to require a module as if harmony features were enabled, this implies the target module will be loaded in a new context.

  • '--harmony_collections'
  • '--harmony_modules'
  • '--harmony_proxies'
  • '--harmony_scoping'
  • '--harmony_typeof'

Example

test.js

var sf = require('setflags');
sf.harmonyRequire('./test-harmony');

test-harmony.js

'use strict';
let x = '100';
console.log('x', x);
exports.wm = new WeakMap();

License

MIT

0.0.2

11 years ago

0.0.1

11 years ago