Socket
Socket
Sign inDemoInstall

pkg-resolve

Package Overview
Dependencies
310
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    pkg-resolve

Front-end Oriented Package Resolver for JSPM/NPM Packages


Version published
Maintainers
1
Install size
32.7 MB
Created

Readme

Source
JSPM Logo

Package Resolve
Sponsored by Version Downloads Build Status Dependencies

Package Resolver (JSPM+NPM) which supports JavaScript and CSS packages. Preferes ES6 Module files following jsnext:main flag in package configuration. Also respects alternative style entries as main package entry point.

The solution was mainly thought for offering a powerful JSPM-capable include mechanism for PostCSS.

  • GitHub
  • NPM

Installation

Should be installed locally in your project source code:

npm install pkg-resolve --save-dev

Usage

Integrate like this in your e.g. gulpfile.js or other packages:

import resolver from "pkg-resolve"

resolver("lodash/map").then((path) => {
  console.log("Path of lodash/map implementation:", path)
});

resolver("normalize.css").then((path) => {
  console.log("Path of normalize.css main entry:", path)
});

Usage for PostCSS

You are also able to combine the import functionality with PostCSS Import. That's pretty neat to include CSS files and other referenced assets which are installed with JSPM inside the local project.

  1. Install normalize.css: jspm install npm:normalize.css
  2. Include it via PostCSS include: @import "normalize.css";
Sebastian Software GmbH Logo

Copyright 2016
Sebastian Software GmbH

Keywords

FAQs

Last updated on 25 May 2016

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc