# js-to-sass-types

> Convert JavaScript types to node-sass types

Latest version **0.0.2** (published 2017-06-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install js-to-sass-types
pnpm add js-to-sass-types
yarn add js-to-sass-types
bun add js-to-sass-types
```

## 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.0.2 |
| Published | 2017-06-15 |
| First published | 2017-05-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Luka Zakrajšek |
| Maintainers | bancek |
| Keywords | sass, scss, css, json |

## Links

- npm: https://www.npmjs.com/package/js-to-sass-types
- Repository: https://github.com/bancek/js-to-sass-types
- Issues: https://github.com/bancek/js-to-sass-types/issues
- npm.io page: https://npm.io/package/js-to-sass-types

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.0.2 (latest) — 2017-06-15
- 0.0.1 — 2017-05-06

## README

# js-to-sass-types [![npm version](https://badge.fury.io/js/js-to-sass-types.svg)](http://badge.fury.io/js/js-to-sass-types)

Convert JavaScript types to node-sass types.

## Installation

```sh
$ npm install --save js-to-sass-types
```

## Usage

`sass-config.json`

```js
{
  "colors": {
    "text": "#fff"
  }
}
```

`style.scss`

```css
$config: getconfig();
$colors: map-get($config, "colors");
$color-text: map-get($colors, "text");

body {
  color: $color-text;
}
```

```js
var sass = require('node-sass');
var convert = require('js-to-sass-types').convert;

var config = convert(require('./sass-config.json'));

var res = sass.renderSync({
  file: './style.scss',
  functions: {
    'getconfig()': function () {
      return config;
    }
  }
});

console.log(res.css.toString());
```
## License

MIT © Luka Zakrajšek

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