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

@jsenv/import-map

Package Overview
Dependencies
Maintainers
2
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jsenv/import-map

[![npm package](https://img.shields.io/npm/v/@jsenv/import-map.svg)](https://www.npmjs.com/package/@jsenv/import-map) [![build](https://travis-ci.com/jsenv/jsenv-import-map.svg?branch=master)](http://travis-ci.com/jsenv/jsenv-import-map) [![codecov](https

  • 5.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
44
decreased by-41.33%
Maintainers
2
Weekly downloads
 
Created
Source

jsenv-import-map

npm package build codecov

importMap programmatic implementation

Introduction

jsenv-import-map implements importMap in native js. It is used by jsenv to use importMap even if they are not yet supported.
— see importMap spec

It has the following exports

  • applyImportMap
  • composeTwoImportMaps
  • normalizeImportMap
  • resolveImport
  • resolveSpecifier
  • wrapImportMap

resolveImport

takes { specifier, importer, importMap, defaultExtension } and returns an url.

import { resolvePath } from "@jsenv/module-resolution"

const importUrl = resolveImport({
  specifier: "../index.js",
  importer: "http://domain.com/folder/file.js",
  importMap: {
    imports: {
      "http://domain.com/index.js": "http://domain.com/main.js",
    },
  },
})

console.log(importUrl)

The code above logs http://domain.com/main.js.

Installation

npm install @jsenv/import-map@1.0.0
yarn add @jsenv/import-map@1.0.0

FAQs

Package last updated on 20 Sep 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

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