
Company News
Andrew Becherer Joins Socket as Chief Information Security Officer
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.
@gotamedia/shapeshifter
Advanced tools
Shapeshifter is a NewsML to NinJS converter. It specifically converts Infomaker NewsML-G2 articles to the Gota Media NinJS extended format.
Shapeshifter is a NewsML to NinJS converter. It specifically converts Infomaker NewsML-G2 articles to the Gota Media NinJS extended format.
npm install --save @gotamedia/shapeshifter
Shapeshifter comes with a very simple API. The idea is to use an article factory to create articles from DOM objects. The articles can then easily be converted into JSON using the JavaScript JSON API.
To create the DOM object you can use any suitable XML engine but the CLI tool uses xmldom.
const { ArticleFactory, AssociationFactory, GeometryFactory } = require("@gotamedia/shapeshifter");
const { DOMParser } = require("xmldom");
const articleDom = new DOMParser().parseFromString(xmlString);
const article = new ArticleFactory(new AssociationFactory(), new GeometryFactory())
.createArticle(articleDom);
console.log(JSON.stringify(article));
That's it!
If you want the object representation of the article you can use the article.toJSON() method to retrieve that.
Shapeshifter also comes with a convenient CLI tool. You can use it to convert articles in npm scripts or simply on the command line.
The shapeshifter command accepts a single article as stdin input. This makes it easy to use with pipes. Here is a simple example using curl on the command line to fetch and convert an article.
curl --silent --user [credentials] http://xlibris.oc.gota.infomaker.io:8080/opencontent/objects/[uuid] | shapeshifter
And here is an example of converting an article that resides in a file.
shapeshifter < [path/to/article].xml
Shapeshifter is released under the MIT License.
FAQs
Shapeshifter is a general format converter. It converts strings of one format (shape) into a string of another.
The npm package @gotamedia/shapeshifter receives a total of 3 weekly downloads. As such, @gotamedia/shapeshifter popularity was classified as not popular.
We found that @gotamedia/shapeshifter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.

Company News
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.

Security News
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.