Skip to content

qbasic16/less-symbols-parser

 
 

Repository files navigation

less-symbols-parser

A very simple and fast Less Symbols parser.

Travis Status

Install

$ npm i -S less-symbols-parser

Why?

Primarily, this module is designed to work with vscode-less extension.

  • Dependencies free.
  • Returns document Variables, Mixins and Imports.
  • Very fast.

Usage

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 for changelogs for each release version.

License

This software is released under the terms of the MIT license.

About

A very simple and fast Less parser for Mixins, Variables and Imports.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 94.2%
  • CSS 5.8%