Socket
Book a DemoInstallSign in
Socket

@node-loader/import-maps

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@node-loader/import-maps

A nodejs loader for import maps

Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
562
149.78%
Maintainers
1
Weekly downloads
 
Created
Source

node-import-map-loader

A nodejs loader for import maps. This allows you to customize module resolution by creating a node.importmap file.

Installation

npm install --save @node-loader/import-maps

# Or, if you prefer Yarn
yarn add --save @node-loader/import-maps

Usage

Create a file node.importmap in the current working directory:

{
  "imports": {
    "my-module": "file:///Users/name/code/my-module.js"
  }
}

Now create a file that imports the mapped module:

import "my-module";

Now run node with the --experimental-loader flag:

node --experimental-loader @node-loader/import-maps file.js

Configuration

The path to your import map may be configured with the IMPORT_MAP_PATH environment variable:

IMPORT_MAP_PATH=/Users/name/some/dir/node.importmap node --experimental-loader @node-loader/import-maps file.js

Composition

If you wish to combine import maps with other NodeJS loaders, you may do so by using node-loader-core.

FAQs

Package last updated on 05 Sep 2020

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