npm jsparsers
module for file format to format convertors for ini
, yaml
, yml
, dotenv
, conf
, sys
, tsv
, csv
, toml
, json
, xml
, md
, html
, css
, less
, sass
to json
and json back to specific file formats
. This is not a javascript language parser.
Find the demos in the demo folder
npm install jsparsers --save
npm Package: jsparsers
let jsp = require("jsparsers");
let ini = jsp.ini();
ini.readFile()
ini.writeFile()
ini.load()
ini.write()
ini.parse()
ini.serialize()
ini.ini()
ini.toml
ini.tsv
ini.sys
ini.yaml()
ini.yml()
ini.xml()
ini.json()
ini.css()
ini.less()
ini.scss()
ini.sass()
All the file format parsers will have the same functions as above in almost all instances with same usages. The file formats applicable are for ini
, toml
, tsv
, sys
, yaml
, xml
, dotenv
, css
, scss
, sass
, less
, html
.
Each of the parsers follow the following interfaces
namely InterfaceReader
and the parser follows InterfaceJSObjectParser
for all formats and InterfaceJSObjectParserCSS
for all css based parser formats
function InterfaceReader() {
this.readFile
this.writeFile
this.load
this.write
this.parse
this.serialize
}
function InterfaceJSObjectParser(jsObject) {
this.ini
this.toml
this.tsv
this.sys
this.yaml
this.yml
this.xml
this.json
}
function InterfaceJSObjectParserCSS(jsObject) {
InterfaceJSObjectParser
this.css
this.less
this.scss
this.sass
}
Each of the convertors follow the following interfaces
InterfaceReader
for each of the file format and the convertors follow InterfaceJSObjectConvertor
for all normal formats and InterfaceJSObjectConvertorCSS
for css based string convertors
function InterfaceReader() {
this.readFile
this.writeFile
this.load
this.write
this.parse
this.serialize
}
function InterfaceJSObjectConvertor(jsObject) {
this.ini
this.toml
this.tsv
this.sys
this.yaml
this.yml
this.xml
this.json
}
function InterfaceJSObjectConvertorCSS(jsObject) {
InterfaceJSObjectConvertor
this.css
this.less
this.scss
this.sass
}
Both the parsers and convertors
will have
the following final Interface structure
.
InterfaceFileFormat() {
this.readFile
this.writeFile
this.load
this.write
this.parse
this.serialize
this.ini
this.toml
this.tsv
this.sys
this.yaml
this.yml
this.xml
this.json
this.css
this.less
this.scss
this.sass
}
// ini: InterfaceFileFormat
let jsp = require("jsparsers");
let ini = jsp.ini();
ini.readFile()
ini.writeFile()
ini.load()
ini.write()
ini.parse()
ini.serialize()
ini.ini()
ini.toml
ini.tsv
ini.sys
ini.yaml()
ini.yml()
ini.xml()
ini.json()
ini.css()
ini.less()
ini.scss()
ini.sass()
let jsp = require("jsparsers");
let xml = jsp.xml();
let jsp = require("jsparsers");
let toml = jsp.toml();
let jsp = require("jsparsers");
let sys = jsp.sys();
let jsp = require("jsparsers");
let tsv = jsp.tsv();
let jsp = require("jsparsers");
let dotenv = jsp.dotenv();
let jsp = require("jsparsers");
let yaml = jsp.yaml();
let jsp = require("jsparsers");
let css = jsp.css();
let jsp = require("jsparsers");
let scss = jsp.scss();
let jsp = require("jsparsers");
let sass = jsp.sass();
let jsp = require("jsparsers");
let less = jsp.less();
- Seperate DOM and HTML parser Interface to be seperate from others.