Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@shun-shobon/littlexml
Advanced tools
1kB XML library for Node.js, Bun, Deno, Browser, Edge runtime.
1kB XML library for Node.js, Bun, Deno, Browser, Edge runtime.
This library is designed to run on small JavaScript runtimes such as Cloudflare Workers. It also works on Node.js, Bun, Deno, and browsers.
Install package from npm. You can also use yarn/pnpm instead of npm.
If you are using Bun, you can install with bun add
command.
npm install @shun-shobon/littlexml
You can import from the package as @shun-shobon/littlexml
.
import { element, renderToString } from "@shun-shobon/littlexml";
You can directly import from npm:@shun-shobon/littlexml
.
import { element, renderToString } from "npm:littlexml@0.6.2";
You can directly import from unpkg.com
.
import {
element,
renderToString,
} from "https://unpkg.com/@shun-shobon/littlexml@0.6.2";
This example is rendering a sitemap.
import { element, renderToString } from "@shun-shobon/littlexml";
const root = element("urlset")
.attr("xmlns", "http://www.sitemaps.org/schemas/sitemap/0.9")
.attr("xmlns:image", "http://www.google.com/schemas/sitemap-image/1.1")
.child(
element("url")
.child(element("loc").text("https://example.com/"))
.child(element("lastmod").text("2020-01-01"))
.child(element("changefreq").text("daily"))
.child(element("priority").text("0.8"))
.child(
element("image:image")
.child(element("image:loc").text("https://example.com/image.png"))
.child(element("image:caption").text("caption")),
),
);
const xml = renderToString(root, { version: "1.0", indent: 2 });
console.log(xml);
console output:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
<url>
<loc>https://example.com/</loc>
<lastmod>2020-01-01</lastmod>
<changefreq>daily</changefreq>
<priority>0.8</priority>
<image:image>
<image:loc>https://example.com/image.png</image:loc>
<image:caption>caption</image:caption>
</image:image>
</url>
</urlset>
FAQs
1kB XML library for Node.js, Bun, Deno, Browser, Edge runtime.
The npm package @shun-shobon/littlexml receives a total of 0 weekly downloads. As such, @shun-shobon/littlexml popularity was classified as not popular.
We found that @shun-shobon/littlexml demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.