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 🙏

© 2025 – Pkg Stats / Ryan Hefner

auto-parser

v2.1.0

Published

A flexible parser for dynamic data types (stringified data, numbers, JSON, etc.)

Readme

AutoParser

npm version Build Status

A flexible parser that automatically converts stringified data types (like integers, floats, arrays, or JSON) back to their original form. Perfect for low-code/no-code environments where values are often passed as strings but need to be parsed correctly on the backend.

Installation

To install the package via npm:

npm install auto-parser

- **Features**
Automatic Parsing: Detects and converts stringified numbers, arrays, objects, booleans, etc., to their appropriate types.
Flexible: Supports a wide variety of data types (number, boolean, stringified JSON objects, etc.).
Low-Code Friendly: Useful for scenarios like working with low-code/no-code platforms where values are received as strings.
Customizable: Easily extend the parser to handle additional cases as needed.

Usage
Once installed, you can use AutoParser to easily parse stringified values into their correct data types:

Example:

const AutoParser = require('auto-parser');

// Initialize the AutoParser
const parser = new AutoParser();

// Example 1: Parse a number string
let num = parser.parse("123");   // 123 as an integer
console.log(num);  // 123 (number)

// Example 2: Parse a boolean string
let bool = parser.parse("true");  // true as a boolean
console.log(bool);  // true (boolean)

// Example 3: Parse an array string
let arr = parser.parse("[1,2,3]");  // [1, 2, 3] as an array
console.log(arr);  // [1, 2, 3] (array)

// Example 4: Parse a JSON string
let obj = parser.parse('{"name":"John","age":30}');  // Object { name: 'John', age: 30 }
console.log(obj);  // { name: 'John', age: 30 } (object)


Supported Types:
Number: "123" → 123
Boolean: "true" → true, "false" → false
Array: "[1, 2, 3]" → [1, 2, 3]
Object: '{"key":"value"}' → { key: 'value' }
Null: "null" → null
Date: "2021-07-01T00:00:00Z" → Date object
API
AutoParser.parse(input: string) -> any
input: A string that can represent a number, boolean, array, object, or date.
Returns: The parsed value as the appropriate data type (number, boolean, array, object, date, etc.).
Example:

js
Copy code
let result = parser.parse("123");  // Returns number 123
let result = parser.parse("[1,2,3]");  // Returns array [1, 2, 3]


Supported Types:
Number: "123" → 123
Boolean: "true" → true, "false" → false
Array: "[1, 2, 3]" → [1, 2, 3]
Object: '{"key":"value"}' → { key: 'value' }
Null: "null" → null
Date: "2021-07-01T00:00:00Z" → Date object
API
AutoParser.parse(input: string) -> any
input: A string that can represent a number, boolean, array, object, or date.
Returns: The parsed value as the appropriate data type (number, boolean, array, object, date, etc.).
Example:


let result = parser.parse("123");  // Returns number 123
let result = parser.parse("[1,2,3]");  // Returns array [1, 2, 3]

Installation Notes
This package is lightweight (around 8KB) and has no external dependencies, making it a great choice for performance-sensitive projects.
If you encounter any issues or need additional parsing functionality, feel free to extend the parser using custom logic.
Contributing
We welcome contributions! If you'd like to help improve the package:

Fork the repository
Create a feature branch (git checkout -b feature/your-feature)
Commit your changes (git commit -am 'Add new feature')
Push to the branch (git push origin feature/your-feature)
Open a pull request
License
MIT License. See the LICENSE file for details.

Changelog
v1.1.0
Added support for Date parsing.
v1.0.0
Initial release with support for numbers, booleans, arrays, and objects.