Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/less/less-plugin-npm-import
Allows importing from NPM packages
https://github.com/less/less-plugin-npm-import
less-plugin
Last synced: about 6 hours ago
JSON representation
Allows importing from NPM packages
- Host: GitHub
- URL: https://github.com/less/less-plugin-npm-import
- Owner: less
- License: apache-2.0
- Archived: true
- Created: 2014-10-11T14:40:26.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2018-12-07T00:06:21.000Z (almost 6 years ago)
- Last Synced: 2024-05-23T06:32:20.912Z (4 months ago)
- Topics: less-plugin
- Language: JavaScript
- Size: 21.5 KB
- Stars: 78
- Watchers: 12
- Forks: 14
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
**DEPRECATED: Less 3+ in a Node environment will search NPM paths by default.**
[![NPM version](https://badge.fury.io/js/less-plugin-npm-import.svg)](http://badge.fury.io/js/less-plugin-npm-import) [![Dependencies](https://david-dm.org/less/less-plugin-npm-import.svg)](https://david-dm.org/less/less-plugin-npm-import) [![devDependency Status](https://david-dm.org/less/less-plugin-npm-import/dev-status.svg)](https://david-dm.org/less/less-plugin-npm-import#info=devDependencies) [![optionalDependency Status](https://david-dm.org/less/less-plugin-npm-import/optional-status.svg)](https://david-dm.org/less/less-plugin-npm-import#info=optionalDependencies)
less-plugin-npm-import
========================Adds the ability for less to import from npm packages
## lessc usage
Install with npm
```bash
npm install -g less-plugin-npm-import
```In less file:
```
@import "npm://packagename/path/to/file.less";
```or if importing a css file an [import option](http://lesscss.org/features/#import-options) is required:
```
@import (less) "npm://packagename/path/to/file.css";
```css/less extensions not necessary
Options:
prefix - default: npm://## Command line usage
```
lessc --npm-import file.less file.css
lessc --npm-import="prefix=~" file.less file.css
```## Programmatic usage
```
var NpmImportPlugin = require("less-plugin-npm-import"),
options = { plugins: [new NpmImportPlugin({prefix: '~'})] };
less.render(css, options)
.then(...
```## Browser usage
Browser usage is not supported.
Testing
-------run the tests by running `node test`
You require the dev dependencies installed (which includes less)