New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

lessify

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lessify - npm Package Compare versions

Comparing version 0.3.0 to 0.4.0

8

index.js

@@ -5,3 +5,3 @@ var less = require("less")

module.exports = function(file) {
module.exports = function(file, opts) {
var input = '';

@@ -21,3 +21,7 @@ if (/\.less$/i.test(file) === false) {

less.render(input, {filename: file, paths: [path.dirname(file)]}, function(err, css) {
lessOpts = opts || {};
lessOpts.filename = file;
lessOpts.paths = [path.dirname(file)];
less.render(input, lessOpts, function(err, css) {
if (err) {

@@ -24,0 +28,0 @@ self.emit('error', err);

{
"name": "lessify",
"version": "0.3.0",
"version": "0.4.0",
"description": "Middleware and Browserify transform for less files",

@@ -14,3 +14,3 @@ "main": "./index.js",

"through": "~2.3.4",
"less": "~1.5.1",
"less": "~1.7.0",
"cssify": "~0.3.0"

@@ -17,0 +17,0 @@ },

@@ -12,3 +12,3 @@ lessify

``` less
.nav { width: (1 + 1); }
.nav { width: (1 + 1); }
```

@@ -19,6 +19,32 @@

require('some.less');
```
// => we haz css in our bundle!
then
```
> browserify -t lessify entry.js > app.js
```
we haz css in our bundle!
options
=======
Less options can be specified either on the command line:
```
> browserify -t [ lessify --relativeUrls --rootpath http://www.example.com/ ] entry.js
```
Or using the API:
```
var browserify = require('browserify');
var lessify = require('lessify');
var b = browserify();
b.transform({relativeUrls: true, rootpath: 'http://www.example.com/'}, lessify);
...
```
install

@@ -25,0 +51,0 @@ =======

@@ -34,2 +34,18 @@ var test = require('tape')

test('should pass less options', function(t) {
var result = ''
, s = lessify('mycss/test.less', {rootpath: 'mycss/'});
var ts = through(function(d) { result += d; }, function() {
var urlMatch = /url\(\\"(.*?)\\"\)/.exec(result)
t.ok(urlMatch, 'should have background-image url');
t.equal(urlMatch[1], 'mycss/images/cat.jpg', 'should honour rootpath');
t.end();
});
s.pipe(ts);
s.write('body { background-image: url("images/cat.jpg"); }');
s.end();
});
test('should throw on invalid less', function(t) {

@@ -36,0 +52,0 @@ t.plan(1);

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