
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
@basemaps/sprites
Advanced tools
Generate a sprite sheet from a list of sprites
import { Sprites, SvgId } from '@basemaps/sprites';
import { fsa } from '@chunkd/fs';
import { basename } from 'path';
const sprites: SvgId[] = [];
for await (const spritePath of fsa.list('./config/sprites')) {
if (!spritePath.endsWith('.svg')) continue;
sprites.push({ id: basename(spritePath).replace('.svg', ''), buffer: await fsa.read(spritePath) });
}
const generated = await Sprites.generate(sprites, [1, 2, 4]);
for (const res of generated) {
const scaleText = res.pixelRatio === 1 ? '' : `@${res.pixelRatio}x`;
const outputPng = `./sprites${scaleText}.png`;
const outputJson = `./sprites${scaleText}.json`;
await fsa.write(outputPng, res.buffer);
await fsa.write(outputJson, JSON.stringify(res.layout, null, 2));
}
npm install -g @basemaps/sprites
basemaps-sprites --ratio 1 --ratio 2 --retina ./config/sprites/topographic
Outputs:
topographic.json topographic.png
topographic@2x.json topographic@2x.png
Sprites can also be in other formats such as PNG or WebP
# Load only png sprites
basemaps-sprites --extension .png ./config/sprites/topographic
# Load png, webp and svg sprites
basemaps-sprites --extension .png --extension .svg --extension .webp ./config/sprites/topographic
The following test sprites come from openstreetmap-americana
8.0.0 (2025-05-11)
FAQs
Generate a sprite sheet from a list of sprites
The npm package @basemaps/sprites receives a total of 22 weekly downloads. As such, @basemaps/sprites popularity was classified as not popular.
We found that @basemaps/sprites demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.