
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
@buudata/buudata
Advanced tools
Minimalist, dependency-free parser/stringifier for commentable JSON (BuuD), using only Node.js core modules (fs, path).
Dependency-free parser/stringifier for commentable JSON (BuuD format)
// and /* */ style comments# Using npm
npm install @buudata/buudata
# Using yarn
yarn add @buudata/buudata
# Using pnpm
pnpm add @buudata/buudata
const { buuDATA } = require('@buudata/buudata');
// Parse BuuD string (JSON with comments)
const buudString = `
// Configuration file
{
"name": "MyApp", // Application name
"version": "1.0.0",
/*
* Database settings
*/
"database": {
"host": "localhost", // Development server
"port": 3306
}
}`;
// Parse to JavaScript object
const config = buuDATA.parse(buudString);
console.log(config.name); // "MyApp"
// Stringify with comments
const data = { name: "Test", version: "1.0.0" };
const output = buuDATA.stringify(data, [
"Generated configuration",
"Created: " + new Date().toISOString()
]);
console.log(output);
// Output:
// // Generated configuration
// // Created: 2025-11-03T...
//
// {
// "name": "Test",
// "version": "1.0.0"
// }
users.json){
"version": "1.0",
"settings": {
"beta": true
},
"users": [
{
"id": 1,
"name": "user1"
},
{
"id": 2,
"name": "user2"
}
]
}
users.buud){
"version": "1.0", // die Version
"settings": { /* * die settings
* ob der User Beta ist
* */
"beta": true
},
"users": [
{
"id": 1, // User 1
"name": "user1"
},
{
"id": 2, // User 2
"name": "user2"
}
]
}
Key Differences:
///* */buuDATA.parse(buudString): ObjectParses a BuuD string (JSON with comments) into a JavaScript object.
const { buuDATA } = require('@buudata/buudata');
const buudString = `
// App configuration
{
"name": "MyApp", // Application name
"debug": true
}`;
const config = buuDATA.parse(buudString);
// Returns: { name: "MyApp", debug: true }
Parameters:
buudString (string): The BuuD formatted string to parseReturns: JavaScript object
Throws:
TypeError if input is not a stringSyntaxError if JSON is invalid after comment removalbuuDATA.stringify(data, comments?): stringConverts a JavaScript object to a BuuD formatted string with optional comments.
const data = {
name: "MyProject",
version: "2.0.0",
features: ["parsing", "comments"]
};
// With single comment
const result1 = buuDATA.stringify(data, "Project configuration");
// With multiple comments
const result2 = buuDATA.stringify(data, [
"MyProject Configuration",
"Generated on: " + new Date().toLocaleDateString(),
"Author: HonneyBuuModz"
]);
console.log(result2);
// Output:
// // MyProject Configuration
// // Generated on: 11/3/2025
// // Author: HonneyBuuModz
//
// {
// "name": "MyProject",
// "version": "2.0.0",
// "features": [
// "parsing",
// "comments"
// ]
// }
Parameters:
data (any): The JavaScript object to stringifycomments (string|string[], optional): Header comments to addReturns: BuuD formatted string
buuDATA.file.load(filePath): Promise<Object>Loads and parses a BuuD file from disk.
// Load configuration file
const config = await buuDATA.file.load('./config.buud');
console.log(config);
// Load with absolute path
const data = await buuDATA.file.load('/path/to/data.buud');
Parameters:
filePath (string): Path to the BuuD file (relative or absolute)Returns: Promise that resolves to the parsed JavaScript object
Throws: File system errors (file not found, permission denied, etc.)
buuDATA.file.save(filePath, data, comments?): Promise<void>Saves a JavaScript object as a BuuD file with optional comments.
const userData = {
users: [
{ id: 1, name: "Alice", active: true },
{ id: 2, name: "Bob", active: false }
],
lastUpdate: new Date().toISOString()
};
// Save with comments
await buuDATA.file.save('./users.buud', userData, [
"User database",
"Last modified: " + new Date().toLocaleDateString()
]);
// Save without comments
await buuDATA.file.save('./data.buud', userData);
Parameters:
filePath (string): Destination file pathdata (any): JavaScript object to savecomments (string|string[], optional): Header commentsReturns: Promise that resolves when file is saved
const { buuDATA } = require('@buudata/buudata');
class ConfigManager {
constructor(configPath) {
this.configPath = configPath;
}
async load() {
try {
this.config = await buuDATA.file.load(this.configPath);
return this.config;
} catch (error) {
// Return default config if file doesn't exist
this.config = this.getDefaultConfig();
await this.save();
return this.config;
}
}
async save() {
const comments = [
"Application Configuration",
"Auto-generated on: " + new Date().toISOString(),
"Modify with caution!"
];
await buuDATA.file.save(this.configPath, this.config, comments);
}
get(key) {
return this.config[key];
}
set(key, value) {
this.config[key] = value;
}
getDefaultConfig() {
return {
version: "1.0.0",
debug: false,
server: {
host: "localhost",
port: 3000
},
database: {
host: "localhost",
port: 5432,
name: "myapp"
}
};
}
}
// Usage
async function main() {
const config = new ConfigManager('./app.buud');
await config.load();
console.log('Server port:', config.get('server').port);
// Update configuration
config.set('debug', true);
await config.save();
}
main();
const { buuDATA } = require('@buudata/buudata');
const path = require('path');
class DataProcessor {
constructor(inputDir, outputDir) {
this.inputDir = inputDir;
this.outputDir = outputDir;
}
async processFile(filename) {
const inputPath = path.join(this.inputDir, filename);
const outputPath = path.join(this.outputDir, filename.replace('.buud', '.json'));
try {
// Load BuuD file
const data = await buuDATA.file.load(inputPath);
// Process data (example: add timestamp)
data.processedAt = new Date().toISOString();
data.processor = "BuuData v1.0.0";
// Save as standard JSON
const fs = require('fs/promises');
await fs.writeFile(outputPath, JSON.stringify(data, null, 2));
console.log(`โ
Processed: ${filename}`);
return data;
} catch (error) {
console.error(`โ Error processing ${filename}:`, error.message);
throw error;
}
}
async processDirectory() {
const fs = require('fs/promises');
const files = await fs.readdir(this.inputDir);
const buudFiles = files.filter(f => f.endsWith('.buud'));
console.log(`๐ Processing ${buudFiles.length} BuuD files...`);
const results = [];
for (const file of buudFiles) {
const result = await this.processFile(file);
results.push(result);
}
return results;
}
}
// Usage
async function batchProcess() {
const processor = new DataProcessor('./input', './output');
const results = await processor.processDirectory();
console.log(`๐ Processed ${results.length} files successfully!`);
}
batchProcess();
const { buuDATA } = require('@buudata/buudata');
class BuuDatabase {
constructor(filePath) {
this.filePath = filePath;
this.data = { records: [], metadata: {} };
}
async initialize() {
try {
this.data = await buuDATA.file.load(this.filePath);
} catch (error) {
// Create new database file
this.data = {
records: [],
metadata: {
version: "1.0.0",
created: new Date().toISOString(),
lastModified: new Date().toISOString()
}
};
await this.save();
}
}
async save() {
this.data.metadata.lastModified = new Date().toISOString();
const comments = [
"BuuDatabase File",
"Records: " + this.data.records.length,
"Last Modified: " + new Date().toLocaleString()
];
await buuDATA.file.save(this.filePath, this.data, comments);
}
async insert(record) {
const id = this.data.records.length + 1;
const newRecord = {
id,
...record,
createdAt: new Date().toISOString()
};
this.data.records.push(newRecord);
await this.save();
return newRecord;
}
find(query) {
return this.data.records.filter(record => {
return Object.keys(query).every(key => record[key] === query[key]);
});
}
findById(id) {
return this.data.records.find(record => record.id === id);
}
async update(id, updates) {
const record = this.findById(id);
if (!record) throw new Error(`Record with id ${id} not found`);
Object.assign(record, updates, { updatedAt: new Date().toISOString() });
await this.save();
return record;
}
async delete(id) {
const index = this.data.records.findIndex(record => record.id === id);
if (index === -1) throw new Error(`Record with id ${id} not found`);
const deleted = this.data.records.splice(index, 1)[0];
await this.save();
return deleted;
}
count() {
return this.data.records.length;
}
all() {
return [...this.data.records];
}
}
// Usage
async function databaseExample() {
const db = new BuuDatabase('./users.buud');
await db.initialize();
// Insert users
const user1 = await db.insert({ name: "Alice", email: "alice@example.com" });
const user2 = await db.insert({ name: "Bob", email: "bob@example.com" });
console.log('Inserted users:', user1, user2);
// Query users
const allUsers = db.all();
console.log('All users:', allUsers);
// Find specific user
const alice = db.find({ name: "Alice" });
console.log('Found Alice:', alice);
// Update user
await db.update(user1.id, { email: "alice.updated@example.com" });
// Count records
console.log('Total users:', db.count());
// Delete user
await db.delete(user2.id);
console.log('Remaining users:', db.count());
}
databaseExample();
const { buuDATA } = require('@buudata/buudata');
async function robustExample() {
try {
// Handle invalid input type
buuDATA.parse(123); // Throws TypeError
} catch (error) {
if (error instanceof TypeError) {
console.log('Invalid input type:', error.message);
}
}
try {
// Handle invalid JSON
buuDATA.parse('{ invalid json }'); // Throws SyntaxError
} catch (error) {
if (error instanceof SyntaxError) {
console.log('Invalid JSON syntax:', error.message);
}
}
try {
// Handle file not found
await buuDATA.file.load('./nonexistent.buud');
} catch (error) {
if (error.code === 'ENOENT') {
console.log('File not found, creating default...');
const defaultData = { initialized: true };
await buuDATA.file.save('./nonexistent.buud', defaultData);
}
}
try {
// Handle permission errors
await buuDATA.file.save('/root/restricted.buud', {});
} catch (error) {
if (error.code === 'EACCES') {
console.log('Permission denied, trying alternative location...');
await buuDATA.file.save('./restricted.buud', {});
}
}
}
robustExample();
Perfect for:
// and /* */ stylessrc/index.js - Main BuuData librarypackage.json - Package configurationREADME.md - This comprehensive documentationWe welcome contributions! You can:
MIT License - Free and Open Source
This project is licensed under the MIT License, which means you are free to:
The only requirement is to include the original copyright notice and license terms.
Made with ๐ by HonneyBuuModz
๐ If this project helped you, please consider giving it a star! ๐
FAQs
Minimalist, dependency-free parser/stringifier for commentable JSON (BuuD), using only Node.js core modules (fs, path).
We found that @buudata/buudata 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
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.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.