npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

sdx-parser

v1.0.4

Published

A simple, readable alternative to JSON for tabular data. Parse SGX format into JavaScript objects.

Readme

📊 SDX Parser

A beautifully simple, human-readable alternative to JSON for tabular data.

✨ Why SDX?

Stop writing verbose JSON for tabular data. SDX (Simple Data eXchange) makes your data files readable, maintainable, and elegant.

The Problem with JSON

{
  "users": [
    { "id": 1, "name": "Alice", "email": "[email protected]", "age": 28 },
    { "id": 2, "name": "Bob", "email": "[email protected]", "age": 32 },
    { "id": 3, "name": "Charlie", "email": "[email protected]", "age": 25 }
  ]
}

❌ Repetitive keys
❌ Hard to scan visually
❌ Lots of braces and quotes
❌ Difficult to edit manually

The SDX Solution

users:
id, name, email, age
1, Alice, [email protected], 28
2, Bob, [email protected], 32
3, Charlie, [email protected], 25

✅ Clean and minimal
✅ Easy to read and edit
✅ Perfect for config files
✅ Converts to JSON automatically

🚀 Installation

npm install @sewakgautam/sdx

📖 Quick Start

Parse SDX String

const { parseSGX } = require('@sewakgautam/sdx');

const data = `
users:
id, name, email
1, Alice, [email protected]
2, Bob, [email protected]
`;

const result = parseSGX(data);
console.log(result);

Output:

{
  users: [
    { id: 1, name: 'Alice', email: '[email protected]' },
    { id: 2, name: 'Bob', email: '[email protected]' }
  ]
}

Load SDX File

const { loadSGX } = require('@sewakgautam/sdx');

// Load from file
const data = loadSGX('./data/users.sgx');
console.log(data.users[0].name); // "Alice"

📝 Format Specification

SDX format has just three simple rules:

  1. Line 1: Object name + colon (:)
  2. Line 2: Comma-separated headers
  3. Line 3+: Comma-separated values

Example: Products

products:
id, name, price, inStock, category
101, Laptop, 999.99, 50, Electronics
102, Mouse, 24.99, 150, Electronics
103, Desk, 299.00, 30, Furniture

🎯 Features

| Feature | Description | |---------|-------------| | Auto Type Conversion | Numbers are automatically converted from strings | | Whitespace Trimming | Spaces around values are cleaned up | | Simple Syntax | No complex escaping or special characters | | Lightweight | Zero dependencies, minimal footprint | | Node.js Ready | Works seamlessly with Node.js file system |

🔧 API Reference

parseSGX(text)

Parses an SDX format string into a JavaScript object.

Parameters:

  • text (string) - The SDX format string

Returns: Object - Parsed data object

Throws: Error - If format is invalid

Example:

const result = parseSGX('users:\nid, name\n1, Alice');

loadSGX(filePath)

Loads and parses an SDX file from the filesystem.

Parameters:

  • filePath (string) - Path to the .sgx file

Returns: Object - Parsed data object

Throws: Error - If file not found or format is invalid

Example:

const data = loadSGX('./config/settings.sgx');

💡 Use Cases

Configuration Files

database:
host, port, database, username
localhost, 5432, myapp_db, admin

Test Data

testCases:
id, input, expected, description
1, hello, HELLO, Convert to uppercase
2, world, WORLD, Another uppercase test

CSV Alternative

SDX is perfect when you need labeled data but CSV feels too generic:

employees:
employeeId, firstName, lastName, department, salary
E001, John, Doe, Engineering, 95000
E002, Jane, Smith, Marketing, 87000

🎨 Real-World Examples

E-commerce Products

products:
sku, name, price, stock, rating
SKU001, Wireless Mouse, 29.99, 150, 4.5
SKU002, USB Keyboard, 49.99, 75, 4.8
SKU003, Monitor Stand, 39.99, 50, 4.2

API Endpoints Config

endpoints:
name, method, path, rateLimit
getUsers, GET, /api/users, 100
createUser, POST, /api/users, 50
updateUser, PUT, /api/users/:id, 50

Game High Scores

highScores:
rank, player, score, date
1, ProGamer123, 99999, 2025-11-15
2, SpeedRunner, 85000, 2025-11-14
3, CasualPlayer, 72000, 2025-11-13

🤝 Contributing

Contributions are welcome! Feel free to:

  • 🐛 Report bugs
  • 💡 Suggest new features
  • 🔧 Submit pull requests

📄 License

MIT © Sewak Gautam

🌟 Show Your Support

If you find SDX Parser useful, give it a ⭐️ on GitHub!


Made with ❤️ by Sewak Gautam