Parse and return a Song from a file array buffer.
Song
import { readFileSync } from "node:fs";import { fromArrayBuffer } from "@nbsjs/core";// Read a NBS file named "song.nbs"const originalFile = readFileSync("song.nbs");const originalBuffer = new Uint8Array(originalFile).buffer;const song = fromArrayBuffer(originalBuffer);console.dir(song); // Here's ya song! Copy
import { readFileSync } from "node:fs";import { fromArrayBuffer } from "@nbsjs/core";// Read a NBS file named "song.nbs"const originalFile = readFileSync("song.nbs");const originalBuffer = new Uint8Array(originalFile).buffer;const song = fromArrayBuffer(originalBuffer);console.dir(song); // Here's ya song!
Array buffer to parse from
Options for parsing
Parsed song, empty if unsuccessful
Parse and return a
Song
from a file array buffer.Example