1.0.0 • Published 8 months ago

@jtorm/tss-parser v1.0.0

Weekly downloads
-
License
GPL-3.0
Repository
gitlab
Last release
8 months ago

jTorm TSS Parser

Install

npm install @jtorm/tss-parser

Config

OptionTypeDefaultDescription
openingstring'{'Opening tag
closingstring'}'Closing tag
propertySeparatorstring':'Property seperator e.g. key:value/key=value/etc
propertyEndstring';'Property ending tag
propertyShorthandOpeningstring'('Property ending tag
propertyShorthandClosingstring')'Property ending tag
propertyShorthandSeparatorstring','Property ending tag
methodSeparatorstring'->'Method seperator
quotesarray['"', "'", '`']Used quotes in TSS

Example

...
let config = {
  opening: '{',
  closing: '}',
  propertySeparator: ':',
  propertyEnd: ';',
  propertyShorthandOpening: '(',
  propertyShorthandClosing: ')',
  propertyShorthandSeparator: ',',
  methodSeparator: '->',
  quotes: ['"', "'", '`']
};
jTormTSSParser.config(config);

let tss = `
body {
  ->insert {
    m: 'a';
    ->get {
      h: 'template.html';
    }
  }
}
// or shorthand
body->insert(m:'a')->get {
  h: 'template.html';
}
`;

try {
  tss = jTormTSSParser.handle(tss);
  console.log(tss);
} catch (err) {
  console.trace(err);
}
1.0.0

8 months ago

0.0.4

2 years ago

0.0.3

3 years ago

0.0.2

3 years ago