Registry / http-networking / es6-micro-loader

es6-micro-loader

JSON →
library0.2.1jsnpmunverified

A minimal ES6 System loader polyfill for browsers and Node.js, implementing the System.register() format for ES modules. Current stable version is 0.2.1, with infrequent releases. Unlike full implementations like SystemJS, it focuses on a tiny subset of the spec to maintain ES module semantics while remaining lightweight. Supports anonymous and named modules, basic network fetching in browsers, and direct file import in Node.js. Requires a separate Promise polyfill (es6-promise or bluebird). Not actively maintained; consider upgrading to SystemJS for full spec compliance.

npm install es6-micro-loader
INSTALL
IMPORT
SIG · ES6-MICRO-LOADER
E
es6-micro-loader
http-networkingjavascriptv0.2.1
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.

System
var System = require('es6-micro-loader');
import System from 'es6-micro-loader';
Package does not support ESM imports; use CommonJS require().
System.import
System.import('path/to/module').then(function(mod) { /* ... */ });
System.import('path/to/module', callback);
System.import returns a Promise; do not use callback pattern.
System.has
System.has('module-name')
Synchronous check for module existence.

Shows basic usage in Node.js and browser: require the polyfill, then call System.import() with a module path, handling promise resolution.

// In Node.js var System = require('es6-micro-loader'); System.import('path/to/module') .then(function(mod) { console.log('Module loaded', mod); }) .catch(function(err) { console.error('Loading failed', err); }); // In browser after including polyfill <script src="path/to/system-polyfill.min.js"></script> <script> System.import('named/foo').then(function(foo) { foo.init(); }); </script>
Debug
Known issues
deprecatedPackage is in maintenance mode; full spec features not implemented.
fix
Migrate to SystemJS (https://github.com/systemjs/systemjs) for spec-compliant loader.
affects: >=0.0.1
gotchaIn Node.js, System.import() expects a global path from application root, not a relative path.
fix
Use path.resolve() to convert relative paths to absolute before calling System.import().
affects: >=0.0.1
gotchaPackage does not provide a Promise polyfill; Promise must be globally available.
fix
Include a Promise polyfill like es6-promise or bluebird before using System.import().
affects: >=0.0.1
gotchaBrowser version relies on System.baseURL (defaults to '/') to fetch modules; modules must be served from that base path.
fix
Set System.baseURL to the correct base path before importing modules.
affects: >=0.0.1
Errors
Common errors & fixes
Error: Cannot find module 'es6-micro-loader'
Package not installed or installed incorrectly.
fix
Run 'npm install es6-micro-loader --save' and ensure node_modules contains the package.
TypeError: System.import is not a function
System polyfill not loaded or not correctly imported.
fix
In browser: ensure <script> for system-polyfill.js is included. In Node: use var System = require('es6-micro-loader');
TypeError: System.import(...).then is not a function
Promise not available in the environment.
fix
Load a Promise polyfill (e.g., es6-promise) before calling System.import().
Error: Module 'named/foo' not found
Module not registered or path incorrect.
fix
Ensure module is loaded via <script> tag with correct System.register() name, and use exact name in System.import().
Upgrade
Version history
0.2.1latest on npm
Audit
Dependencies
es6-promiseoptionalRequired for Promise-based System.import() calls in older browsers
bluebirdoptionalAlternative Promise polyfill to es6-promise
Agent activity
5 hits · last 30 days
node
4
OpenAI (training)
1
Resources
es6-micro-loader — npm install es6-micro-loader · libregistry