https://github.com/mrmlnc/scss-symbols-parser
A very simple and fast SCSS parser for Mixins, Functions, Variables and Imports.
https://github.com/mrmlnc/scss-symbols-parser
Last synced: over 1 year ago
JSON representation
A very simple and fast SCSS parser for Mixins, Functions, Variables and Imports.
- Host: GitHub
- URL: https://github.com/mrmlnc/scss-symbols-parser
- Owner: mrmlnc
- License: mit
- Created: 2016-10-24T17:29:58.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2019-11-23T10:58:20.000Z (over 6 years ago)
- Last Synced: 2024-10-30T02:28:30.761Z (almost 2 years ago)
- Language: TypeScript
- Homepage:
- Size: 43.9 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# scss-symbols-parser
> A very simple and fast SCSS Symbols parser.
[](https://travis-ci.org/mrmlnc/scss-symbols-parser)
## Install
```shell
$ npm i -S scss-symbols-parser
```
## Why?
Primarily, this module is designed to work with [vscode-scss](https://github.com/mrmlnc/vscode-scss) extension.
* Dependencies free.
* Returns document Variables, Mixins, Functions and Imports.
* Tolerant to errors.
* Very fast.
## Usage
```js
const symbolsParser = require('scss-symbols-parser');
const symbols = symbolsParser.parseSymbols('$a: 1;');
// console.log(symbols);
// {
// variables: [ { name: '$a', value: '1', offset: 0 } ],
// mixins: [],
// functions: [],
// imports: []
// }
```
## Symbols
**variable**
* name: `string`
* value: `string`
* offset: `number`
**mixin**
* name: `string`
* parameters: `variable[]`
* offset: `number`
**function**
* name: `string`
* parameters: `variable[]`
* offset: `number`
**import**
* filepath: `string`
* modes: `string[]`
* dynamic: `boolean` (filepath contains `#`, `{` or `}` or filepaths contains `//` – URLs)
* css: `boolean` (filepath contains `css` extension or mode)
## Changelog
See the [Releases section of our GitHub project](https://github.com/mrmlnc/scss-symbols-parser/releases) for changelogs for each release version.
## License
This software is released under the terms of the MIT license.