https://github.com/mrmlnc/less-symbols-parser
A very simple and fast Less parser for Mixins, Variables and Imports.
https://github.com/mrmlnc/less-symbols-parser
Last synced: 9 months ago
JSON representation
A very simple and fast Less parser for Mixins, Variables and Imports.
- Host: GitHub
- URL: https://github.com/mrmlnc/less-symbols-parser
- Owner: mrmlnc
- License: mit
- Created: 2016-10-21T00:14:13.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2021-08-20T06:25:47.000Z (almost 5 years ago)
- Last Synced: 2025-01-31T10:35:37.484Z (over 1 year ago)
- Language: TypeScript
- Size: 50.8 KB
- Stars: 2
- Watchers: 3
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# less-symbols-parser
> A very simple and fast Less Symbols parser.
## Donate
If you want to thank me, or promote your Issue.
[](https://paypal.me/mrmlnc)
> Sorry, but I have work and support for plugins and modules requires some time after work. I will be glad of your support or PR's.
## Install
```shell
$ npm i -S less-symbols-parser
```
## Why?
Primarily, this module is designed to work with [vscode-less](https://github.com/mrmlnc/vscode-less) extension.
* Dependencies free.
* Returns document Variables, Mixins and Imports.
* Very fast.
## Usage
```js
const symbolsParser = require('less-symbols-parser');
const symbols = symbolsParser.parseSymbols('@a: 1;');
// console.log(symbols);
// {
// variables: [ { name: '@a', value: '1', offset: 0 } ],
// mixins: [],
// imports: []
// }
```
## Symbols
**variable**
* name: `string`
* value: `string`
* offset: `number`
**mixin**
* name: `string`
* parameters: `variable[]`
* offset: `number`
**import**
* filepath: `string`
* modes: `string[]`
* dynamic: `boolean` (filepath contains `@`, `{` or `}`)
* css: `boolean` (filepath contains `css` extension or mode)
## Changelog
See the [Releases section of our GitHub project](https://github.com/mrmlnc/less-symbols-parser/releases) for changelogs for each release version.
## License
This software is released under the terms of the MIT license.