# varlessify

> Browserify transform to require LESS variable values into your JS

Latest version **0.1.1** (published 2015-09-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install varlessify
pnpm add varlessify
yarn add varlessify
bun add varlessify
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2015-09-11 |
| First published | 2014-10-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Greg Smith |
| Maintainers | smrq |
| Keywords | browserify, browserify-transform, less, css |

## Links

- npm: https://www.npmjs.com/package/varlessify
- Repository: https://github.com/smrq/varlessify
- Issues: https://github.com/smrq/varlessify/issues
- npm.io page: https://npm.io/package/varlessify

## Dependencies (3)

- [less](https://npm.io/package/less.md) ^2.5.1
- [through2](https://npm.io/package/through2.md) ^0.6.2
- [static-module](https://npm.io/package/static-module.md) ^1.0.0

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2015-09-11
- 0.1.0 — 2014-10-19
- 0.0.2 — 2014-10-04
- 0.0.1 — 2014-10-04

## README

# varlessify

require() LESS variables into your JS using Browserify

[![NPM version](https://badge.fury.io/js/varlessify.png)](http://badge.fury.io/js/varlessify)
[![build status](https://secure.travis-ci.org/smrq/varlessify.png)](http://travis-ci.org/smrq/varlessify)
[![Dependency status](https://david-dm.org/smrq/varlessify.png)](https://david-dm.org/smrq/varlessify) [![devDependency Status](https://david-dm.org/smrq/varlessify/dev-status.png)](https://david-dm.org/smrq/varlessify#info=devDependencies)

# example usage

If you have a `variables.less` file:

``` less
@foo: #fff;
@bar: 1 + 1;
@baz: @bar + @bar;
```

and a `main.js`:

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

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

you get...

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

# how to script

``` js
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:

``` sh
$ browserify main.js -t varlessify > bundle.js
```

Or, with options:

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

With the Browserify API:

``` js
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](https://npmjs.org/) installation:

``` sh
npm install varlessify
```

# license

MIT

---
_Source: https://npm.io/package/varlessify · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
