Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@jspm/node-importmap-loader

Package Overview
Dependencies
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jspm/node-importmap-loader

JSPM's node importmap loader ⚡️

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
3
Weekly downloads
 
Created
Source

WIP: @jspm/node-importmap-loader

Don't bother installing dependencies you don't need to! 🏇🏻💨

With JSPM node-importmap-loader, installing dependencies is a thing of the past! You can reference and execute them directly! Maximize productivity ⚡️, decrease security risk 🚔, and probably do other awesome things too! Use JSPM node-importmap-loader today!

I'm skeptical, is this for real?

Sort, yes and no—but it's close! This project's focus is to enable you to use import maps with Node if you have familiarity in the space. Meanwhile, we'll be working dev ex to make using this as seemless as possible.

How does this work?

JSPM uses Node's experimental loader methodology with JSPM's import map technology to allow you 🫵 to import dependencies directly from a cdn source without needing to install them!

📣 More how-tos, documentation coming soon!

Usage

When executing

node --loader ./dist/loader.js test.js

The following will be output

 loader git:(main) node --loader ./loader.js test.js
(node:12944) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
testing
{
  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
    usingClientEntryPoint: false,
    Events: [
      [Function: getInstanceFromNode],
      [Function: getNodeFromInstance],
      [Function: getFiberCurrentPropsFromNode],
      [Function: enqueueStateRestore],
      [Function: restoreStateIfNeeded],
      [Function: batchedUpdates$1]
    ]
  },
  createPortal: [Function: createPortal$1],
  createRoot: [Function: createRoot$1],
  findDOMNode: [Function: findDOMNode],
  flushSync: [Function: flushSync$1],
  hydrate: [Function: hydrate],
  hydrateRoot: [Function: hydrateRoot$1],
  render: [Function: render],
  unmountComponentAtNode: [Function: unmountComponentAtNode],
  unstable_batchedUpdates: [Function: batchedUpdates$1],
  unstable_renderSubtreeIntoContainer: [Function: renderSubtreeIntoContainer],
  version: '18.2.0'
}

Size Benefits

One very significant upside of using deps using the loader and import-map. The dependencies from test.js loads

du -sh -I @jspm -I fs-extra -I node-fetch node_modules
50M    node_modules
du -sh .cache
3.6M    .cache

Local Development

Try it yourself!

Clone

git clone git@github.com:jspm/node-importmap-http-loader.git

Then, via devcontainers, launch the container by clicking the devcontainer button or via the command palette.

To setup devcontainers

  1. Launch vscode or your favorite devcontainers enabled editor
  2. Install Remote Containers extension
  3. Launch the container by clicking the devcontainer button or via the command palette

Unrecommended and supported for issues, etc:

git clone git@github.com:jspm/node-importmap-http-loader.git
n install auto && npm install

FAQs

Package last updated on 22 Aug 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc