6.1.0 • Published 2 years ago

remixml-jsobj v6.1.0

Weekly downloads
15
License
(ISC OR GPL-3.0)
Repository
github
Last release
2 years ago

NPM version Downloads Rate on Openbase

Remixml component that renders directly to and from the javascript objects that can be converted to JSON and back.

Basic usage

From HTML to JSON and back:

var htmlstring = "<h1>This is a test</h1><p class='main'>Foo Bar</p>";
var abstract = Remixml.compile(htmlstring)({});
Remixmljsobj.abstract2jsobj(abstract);
console.log(JSON.stringify(abstract));
Remixmljsobj.jsobj2abstract(abstract);
var newstring = Remixml.abstract2txt(abstract, 1);
console.log(newstring);

Requirements

It runs inside any webbrowser or NodeJS environment.

Reference documentation

  • Remixmljsobj.abstract2jsobj(abstract) Converts a DOM abstract into a Javascript object, the function is destructive to the abstract argument and performs an in-situ transformation. Use JSON.stringify() to turn it into JSON.
  • Remixmljsobj.jsobj2abstract(jsobj) Converts a Javascript object to a DOM abstract, the function is destructive to the abstract argument and performs an in-situ transformation. Use JSON.parse() to convert from JSON to the Javascript object.

References

Card-carrying member of the zerodeps movement.

6.1.0

2 years ago

6.0.1

2 years ago

6.0.0

2 years ago

4.1.0

3 years ago

4.0.3

3 years ago

4.0.2

3 years ago

4.0.1

3 years ago

4.0.0

3 years ago