# scss-tokenizer

> A tokenzier for Sass' SCSS syntax

Latest version **0.4.3** (published 2022-08-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install scss-tokenizer
pnpm add scss-tokenizer
yarn add scss-tokenizer
bun add scss-tokenizer
```

## 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.4.3 |
| Published | 2022-08-10 |
| First published | 2015-06-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 39.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 25 |
| Author | xzyfer |
| Maintainers | xzyfer |
| Keywords | parser, tokenizer, sass, scss, libsass |

## Links

- npm: https://www.npmjs.com/package/scss-tokenizer
- Repository: https://github.com/sasstools/scss-tokenizer
- Issues: https://github.com/sasstools/scss-tokenizer/issues
- npm.io page: https://npm.io/package/scss-tokenizer

## Dependencies (2)

- [js-base64](https://npm.io/package/js-base64.md) ^2.4.9
- [source-map](https://npm.io/package/source-map.md) ^0.7.3

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 0.4.3 (latest) — 2022-08-10
- 0.4.2 — 2018-12-03
- 0.4.1 — 2018-12-03
- 0.4.0 — 2018-12-03
- 0.3.0 — 2018-04-16
- 0.2.3 — 2017-05-12
- 0.2.2 — 2017-05-12
- 0.2.1 — 2017-04-29
- 0.2.0 — 2017-04-29
- 0.1.2 — 2017-01-29
- 0.1.1 — 2017-01-29
- 0.1.0 — 2017-01-29
- 0.0.1 — 2015-06-09

## README

# scss-tokenizer
A tokenizer for Sass' SCSS syntax

![https://travis-ci.org/sasstools/scss-tokenizer.svg?branch=master](https://img.shields.io/travis/sasstools/scss-tokenizer.svg)
![https://www.npmjs.com/package/scss-tokenizer](https://img.shields.io/npm/v/scss-tokenizer.svg)
![https://github.com/sasstools/scss-tokenizer/issues](https://img.shields.io/github/issues/sasstools/scss-tokenizer.svg)
![](https://img.shields.io/github/license/sasstools/scss-tokenizer.svg)

# Install

```
npm install scss-tokenizer
```

# Usage

```js
var scss = require('scss-tokenizer');
scss.tokenize(css);
```

# API

### `tokenize`

Tokenizes source `css` and returns an ordered array of tokens with positional
data.

```js
var tokenizer = require('scss-tokenizer');
var tokens = tokenize.tokenize(css);
```

Arguments:

* `css (string|#toString)`: String with input CSS or any object
  with `toString()` method, like file stream.
* `opts (object) optional`: options:
  * `from`: the path to the source CSS file. You should always set `from`,
    because it is used in map generation and in syntax error messages.

# Test

```
npm test
```

## Attribution

This project started as a fork of the [PostCSS](https://github.com/postcss/postcss) tokenizer.

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