Socket
Socket
Sign inDemoInstall

varlessify

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

varlessify

Browserify transform to require LESS variable values into your JS


Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Install size
Created

Readme

Source

varlessify

require() LESS variables into your JS using Browserify

NPM version build status Dependency status devDependency Status

example usage

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 browserifying:

$ browserify main.js -t [ varlessify --file ./variables.less ] > bundle.js

you get...

var foo = "#ffffff";
var bar = "2";
var baz = "4";
console.log(foo, bar, baz);

how to script

varless.get(variable)
varless.get(lessFile, variable)

You can specify the less file either as a parameter to varless.get or as a build option. If both are specified, the parameter takes precedence.

how to browserify

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();

transform options

file

A file to parse for variable declarations by default.

paths

An array of paths to search for during LESS parsing of @import declarations.

installation

Just plain ol' npm installation:

npm install varlessify

license

MIT

Keywords

FAQs

Package last updated on 11 Sep 2015

Did you know?

Socket

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
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc