Skip to content

npm jsparsers module for file format to format convertors for ini, toml, tsv, sys, yaml, json, xml, html, css, less, sass, md, conf.

License

Notifications You must be signed in to change notification settings

ganeshkbhat/convertors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jsparsers

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.

DEMOS

Find the demos in the demo folder

INSTALLATION

npm install jsparsers --save

npm Package: jsparsers

USAGE


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

ini


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()


xml


let jsp = require("jsparsers");
let xml = jsp.xml();

toml


let jsp = require("jsparsers");
let toml = jsp.toml();

sys


let jsp = require("jsparsers");
let sys = jsp.sys();

tsv


let jsp = require("jsparsers");
let tsv = jsp.tsv();

dotenv


let jsp = require("jsparsers");
let dotenv = jsp.dotenv();

yaml


let jsp = require("jsparsers");
let yaml = jsp.yaml();

css


let jsp = require("jsparsers");
let css = jsp.css();

scss


let jsp = require("jsparsers");
let scss = jsp.scss();

sass


let jsp = require("jsparsers");
let sass = jsp.sass();

less


let jsp = require("jsparsers");
let less = jsp.less();

TODO

  • Seperate DOM and HTML parser Interface to be seperate from others.

About

npm jsparsers module for file format to format convertors for ini, toml, tsv, sys, yaml, json, xml, html, css, less, sass, md, conf.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages