1.0.0 • Published 9 years ago

dtd-file v1.0.0

Weekly downloads
2
License
ISC
Repository
github
Last release
9 years ago

Just parse DTD files, especially created for Firefox localization DTD files

Install

npm i dtd-file

Usage

Parse dtd contents

var parser = require("dtd-file");

var res = parser.parse(dtdContents);
// if in dtdContents you have:
// <!entity key1 "value1">
// <!entity key2 "value2">
// in res you will get an object:
// {
//   "key1": "value1",
//   "key2": "value2"
// }

Stringify object to DTD file contents

var parser = require("dtd-file");

var res = parser.stringify({
  key1: "value1",
  key2: "value2"
});
// in res you will get
// <!ENTITY key1 "value1">
// <!ENTITY key2 "value2">