Registry / devops / future-node

future-node

JSON →
library0.0.2jsnpmunverified

A Node.js require hook that allows modules to specify their own transpilers via package.json configuration, inspired by browserify transform system. Version 0.0.2 is in early development with no specific release cadence. It replaces Node's built-in extension hooks with a flexible transpiler pipeline, enabling per-file transpilation options. Bundled with an ES2016 transpiler for convenience. Unlike babel-register or ts-node, it decouples transpiler selection from the main application, letting dependencies declare their own transforms. Lacks active maintenance and usage is minimal.

npm install future-node
INSTALL
IMPORT
SIG · FUTURE-NODE
F
future-node
devopsjavascriptv0.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

future-node
require('future-node')
import 'future-node'
This is a side-effect module that must be required before any modules you want to transpile. CJS only, no ESM support.
CLI
npx future-node my-app
npm run future-node my-app
CLI command installed globally or via npx. Do not use npm run if not in scripts.
transpile config in package.json
{"transpile":[["*.js","!sourcegraph/babel->js",{"stage":0}]]}
{"transpile":{"*.js":"babel"}}
Config must be an array of arrays, not an object. Each entry: [pattern, module, options?].

Shows minimal usage: require the hook, then run any JS file; transpile configuration optional.

// Install: npm install future-node // Create app.js require('future-node'); const fn = () => 'Hello from future-node!'; console.log(fn()); // In package.json, enable transpilation: { "transpile": [ ["*.js", "!sourcegraph/babel->js", {"stage": 0}] ] } // Run: node app.js
Debug
Known issues
deprecatedPackage is effectively abandoned since 2016. No updates, no support for modern Node versions (>=12).
fix
Use babel-register or esm for Node transpilation instead.
affects: >=0.0.2
gotchaThe bundled ES2016 transpiler '!sourcegraph/babel->js' expects a non-standard syntax derived from Sourcegraph browser build tooling.
fix
Use standard babel-preset-env with babel-register for predictable behavior.
affects: >=0.0.0
gotchaTranspile patterns are glob-like but not standard globs; they match file extensions only, not full paths.
fix
Use patterns like '*.js' not 'src/**/*.js'.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'future-node'
Module not installed or not in node_modules.
fix
Run 'npm install future-node' in project root.
TypeError: future_node is not a function
Attempt to import or assign require('future-node') to variable; it modifies require.extensions, does not export anything.
fix
Use 'require('future-node')' as a bare require, no assignment.
SyntaxError: Unexpected token import
transpile config missing for .js files with ES modules; Node does not support import natively.
fix
Add transpile entry for '*.js' with a babel transform that handles ES module syntax.
Upgrade
Version history
0.0.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
future-node — npm install future-node · libregistry