
Product
Introducing Scala and Kotlin Support in Socket
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
node-taglib-sharp-extend
Advanced tools
extend node-taglib-sharp with:
MemoryFileAbstraction
for file in memoryUint8Array
/ File
/ FileSystemFileHandle
built-in:
import { File, MemoryFileAbstraction } from 'node-taglib-sharp-extend'
export function getFile(fileName: string, buffer: Uint8Array | Buffer | number[]): File {
return File.createFromAbstraction(
new MemoryFileAbstraction(fileName, buffer),
)
}
// `File.save` will not flush original buffer, so need function to get current buffer
export function getBuffer(metadata: File): Uint8Array | undefined {
const abstraction = metadata.fileAbstraction
return abstraction instanceof MemoryFileAbstraction
? abstraction.current()
: undefined
}
import { parseFile } from 'node-taglib-sharp-extend/utils'
async function handleChange(target: EventTarget) {
const file = (target as HTMLInputElement)?.files?.[0]
if (file) {
const [
getMetaFile,
{ flush, fetchMetadata, clear, currentBuffer, updateTag }
] = await parseFile(file)
const _file = getMetaFile()
_file.tag.album = 'test album'
updateTag('artists', ['test artists']) // type safe
console.log(fetchMetadata())
flush()
console.log(currentBuffer().byteLength)
clear()
}
}
if you want to run in browser, you need to polyfill some node modules
there is a built-in vite plugin for polyfill, and need to install vite-plugin-node-polyfills
import { defineConfig } from 'vite'
import { polyfillTaglib } from 'node-taglib-sharp-extend/vite'
export default defineConfig({
plugins: [
// allow extra node polyfill options
polyfillTaglib(),
],
})
FAQs
read and write audio file metadata in nodejs / browser(memory)
The npm package node-taglib-sharp-extend receives a total of 151 weekly downloads. As such, node-taglib-sharp-extend popularity was classified as not popular.
We found that node-taglib-sharp-extend demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Application Security
/Security News
Socket CEO Feross Aboukhadijeh and a16z partner Joel de la Garza discuss vibe coding, AI-driven software development, and how the rise of LLMs, despite their risks, still points toward a more secure and innovative future.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.