
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
stem-splitter-api
Advanced tools
JavaScript/TypeScript SDK for Stem Splitter API - Easy audio stem separation
Easy-to-use JavaScript/TypeScript SDK for the Stem Splitter API. Separate audio files into stems (vocals, drums, bass, etc.) with just a few lines of code.
npm install stem-splitter-api
# or
yarn add stem-splitter-api
# or
pnpm add stem-splitter-api
import { StemSplitterClient } from 'stem-splitter-api';
import fs from 'fs';
// Create client
const client = new StemSplitterClient({
baseUrl: 'https://stem-splitter-api-production.up.railway.app'
});
// Separate audio file
const result = await client.separate('./audio.mp3', { stems: 2 });
// Save result
fs.writeFileSync('output.zip', result.data);
console.log(`Saved: ${result.filename}`);
StemSplitterClientMain client class for interacting with the Stem Splitter API.
new StemSplitterClient(options?: StemSplitterOptions)
Options:
baseUrl (string, optional): API base URL (default: 'https://stem-splitter-api-production.up.railway.app')timeout (number, optional): Request timeout in milliseconds (default: 300000 = 5 minutes)separate(filePath, options?)Separate an audio file from the file system.
Parameters:
filePath (string): Path to the audio fileoptions (object, optional):
stems (2 | 4 | 5): Number of stems (default: 2)Returns: Promise<SeparationResult>
Example:
const result = await client.separate('./song.mp3', { stems: 4 });
separateFromBuffer(buffer, filename, options?)Separate an audio file from a buffer.
Parameters:
buffer (Buffer): Audio file bufferfilename (string): Original filenameoptions (object, optional):
stems (2 | 4 | 5): Number of stems (default: 2)Returns: Promise<SeparationResult>
Example:
const audioBuffer = fs.readFileSync('./song.mp3');
const result = await client.separateFromBuffer(audioBuffer, 'song.mp3', { stems: 2 });
healthCheck()Check API health status.
Returns: Promise<HealthStatus>
Example:
const health = await client.healthCheck();
console.log(health.status); // "healthy"
console.log(health.disk_space_gb); // Available disk space
console.log(health.allowed_extensions); // [".flac", ".m4a", ".mp3", ...]
getInfo()Get API information from root endpoint.
Returns: Promise<ApiInfo>
Example:
const info = await client.getInfo();
console.log(info.message); // "Stem Splitter API is running"
console.log(info.docs); // "/docs"
import { StemSplitterClient } from 'stem-splitter-api';
import fs from 'fs';
import path from 'path';
async function main() {
const client = new StemSplitterClient({
baseUrl: 'https://stem-splitter-api-production.up.railway.app',
timeout: 600000, // 10 minutes
});
try {
// Check health
const health = await client.healthCheck();
console.log('API Status:', health.status);
console.log('Max file size:', health.max_file_size_mb, 'MB');
// Separate audio
console.log('Separating audio...');
const result = await client.separate('./input.mp3', { stems: 2 });
// Save output
const outputPath = path.join(__dirname, 'output.zip');
fs.writeFileSync(outputPath, result.data);
console.log(`Saved to: ${outputPath}`);
console.log(`Request ID: ${result.requestId}`);
} catch (error) {
console.error('Error:', error.message);
}
}
main();
import { StemSplitterClient } from 'stem-splitter-api';
const client = new StemSplitterClient({
baseUrl: 'https://stem-splitter-api-production.up.railway.app',
});
async function handleFileUpload(file: File) {
try {
// Convert File to Buffer (in browser)
const arrayBuffer = await file.arrayBuffer();
const buffer = Buffer.from(arrayBuffer);
// Separate audio
const result = await client.separateFromBuffer(buffer, file.name, { stems: 2 });
// Download result
const blob = new Blob([result.data], { type: 'application/zip' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = result.filename;
a.click();
URL.revokeObjectURL(url);
} catch (error) {
console.error('Error:', error.message);
}
}
try {
const result = await client.separate('./audio.mp3', { stems: 2 });
// Handle success
} catch (error) {
if (error.message.includes('File too large')) {
console.error('File exceeds maximum size limit');
} else if (error.message.includes('Invalid file type')) {
console.error('File type not supported');
} else if (error.message.includes('timeout')) {
console.error('Request timed out - file may be too large or processing too slow');
} else {
console.error('Unexpected error:', error.message);
}
}
Full TypeScript definitions are included. The package exports all types:
import {
StemSplitterClient,
StemSplitterOptions,
SeparationOptions,
SeparationResult,
HealthStatus,
ApiInfo,
} from 'stem-splitter-api';
MIT
For API documentation and support, visit the API docs at /docs endpoint.
FAQs
JavaScript/TypeScript SDK for Stem Splitter API - Easy audio stem separation
We found that stem-splitter-api 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.