GithubHelp home page GithubHelp logo

ganeshkbhat / convertors Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 1.39 MB

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

License: MIT License

JavaScript 99.62% TypeScript 0.38%

convertors's Introduction

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.

convertors's People

Contributors

dependabot[bot] avatar ganeshkbhat avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.