Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

varlessify

require() LESS variables into your JS

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 varless = require('varless');
var foo = "#ffffff";
var bar = "2";
var baz = "4";
console.log(foo, bar, baz);

how to script

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.

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 04 Oct 2014

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

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc