Security News
JavaScript Leaders Demand Oracle Release the JavaScript Trademark
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
require() LESS variables into your JS
If you have a variables.less
file:
@foo: #fff;
@bar: 1 + 1;
@baz: @bar + @bar;
and a main.js
:
var varless = require('varless');
var foo = varless.get('foo');
var bar = varless.get('bar');
var baz = varless.get('baz');
console.log(foo, bar, baz);
then after browserify
ing:
$ browserify main.js -t [ varlessify --file ./variables.less ] > bundle.js
you get...
var varless = require('varless');
var foo = "#ffffff";
var bar = "2";
var baz = "4";
console.log(foo, bar, baz);
varless.get([lessFile], variable)
You can specify the less file either in your JS or as a build option. If both are specified, the script takes precedence.
On the command line:
$ browserify main.js -t varlessify > bundle.js
Or, with options:
$ browserify main.js -t [ varlessify --file ./variables.less ] > bundle.js
With the Browserify API:
browserify()
.add('main.js')
.transform('varlessify', { file: './variables.less' })
.bundle();
A file to parse for variable declarations by default.
An array of paths to search for during LESS parsing of @import declarations.
Just plain ol' npm installation:
npm install varlessify
MIT
FAQs
Browserify transform to require LESS variable values into your JS
The npm package varlessify receives a total of 8 weekly downloads. As such, varlessify popularity was classified as not popular.
We found that varlessify demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.