🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@feature-hub/systemjs

Package Overview
Dependencies
Maintainers
4
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@feature-hub/systemjs

Dynamic ES module loader

latest
Source
npmnpm
Version
0.21.9
Version published
Maintainers
4
Created
Source

SystemJS

Build Status Gitter Sponsor

Configurable module loader enabling dynamic ES module workflows in browsers and NodeJS.

Try out the SystemJS 2.0 alpha release

SystemJS is currently sponsored by Canopy Tax.

  • Loads any module format when running the ~15KB development build.
  • Loads ES modules compiled into the System.register module format for production with exact circular reference and binding support
  • Supports RequireJS-style map, paths, and bundles configuration.

Built with the ES Module Loader project, which is based on principles and APIs from the WhatWG Loader specification, modules in HTML and NodeJS.

For discussion, join the Gitter Room.

Documentation

Basic Use

Browser Development

<script src="systemjs/dist/system.js"></script>
<script>
  SystemJS.import('/js/main.js');
</script>

The above will support loading all module formats.

To load ES6 code with in-browser transpilation, one of the following transpiler plugins must be configured:

Browser Production

When all modules are available as either system, amd or global module formats, and no package configurations or plugins are needed, a production-only loader can be used:

<script src="systemjs/dist/system-production.js"></script>
<script>
  SystemJS.import('/js/main.js');
</script>

Configuration support in the production loader includes baseURL, paths, map, depCache and wasm.

NodeJS

To load modules in NodeJS, install SystemJS with:

  npm install systemjs

If transpiling ES modules, install the transpiler plugin following the instructions from the transpiler project page.

We can then load modules equivalently in NodeJS as we do in the browser:

var SystemJS = require('systemjs');

// loads './app.js' from the current directory
SystemJS.import('./app.js').then(function (m) {
  console.log(m);
});

To import a module with the NodeJS module resolution, import with import moduleName from '@node/module-name'.

Running the tests

  npm run build && npm run test

License

MIT

FAQs

Package last updated on 23 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts