pkg-resolve
Front-end Oriented Package Resolver for JSPM/NPM Packages
Last updated 9 years ago by swernerx .
Apache-2.0 · Repository · Bugs · Original npm
$ cnpm install pkg-resolve 
SYNC missed versions from official npm registry.
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.

Links

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";

Copyright

Sebastian Software GmbH Logo

Copyright 2016
Sebastian Software GmbH

Current Tags

  • 0.2.2                                ...           latest (9 years ago)

2 Versions

  • 0.2.2                                ...           9 years ago
  • 0.1.14                                ...           9 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (6)
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org