bsmap is a general-purpose TypeScript library for creating, reading, and modifying Beat Saber beatmaps programmatically. Current stable version is 2.3.4. Maintained actively with frequent releases (every few months). It supports all major beatmap schema versions (v1 through v4.1.0) and modding extensions like Chroma, Cinema, Noodle Extensions, and Mapping Extensions out of the box. Key differentiators: fully-typed schema wrappers for cross-version compatibility, partial object creation with default filling, tree-shakeable modules, built-in validators and optimisers, and utilities for math, color, and easing. Works with Deno, Bun, Node.js (ESM/CJS), and browser bundlers.
npm install bsmapNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Reads a v4 difficulty file, adds a note at beat 10, and writes the modified beatmap back. Uses synchronous file I/O and the V4Note wrapper.
Replace new Beatmap(data) or Beatmap.create(data) with Beatmap.fromJSON(data).
Use import * as bsmap from 'bsmap' (ESM) or const bsmap = require('bsmap') (CJS).Import utility classes from their respective subpaths for tree-shaking and future compatibility.
Update any v3 beatmap code to handle new FX event structures. Old v3 events still parse but may not serialize correctly.
Use ESM (import * as bsmap from 'bsmap') in TypeScript or with ts-node. For plain JS, types are not needed.
Always provide all required fields or use fromJSON() to fill defaults. Use the 'defaults' utility to apply schema defaults if needed.
Use Beatmap.fromJSON(data) instead of new Beatmap(data).
Create script.js and add import * as bsmap from 'bsmap' (ESM) or use require('bsmap') (CJS).Import Beats from only one source, preferably 'bsmap/beats'.
Update to bsmap >=1.5.0 and use the correct schema property names (e.g., colorNotes instead of notes).