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

@isuckatbeingsocial/parse-cs

v1.0.9

Published

**ParseCS** is a C# parsing library written in pure JavaScript, featuring a basic plugin system. It requires no external dependencies beyond those used by Webpack.

Readme

ParseCS

ParseCS is a C# parsing library written in pure JavaScript, featuring a basic plugin system. It requires no external dependencies beyond those used by Webpack.

  • Roughly supports C# versions between 1.0 and 3.0.

Release Notes

Version 1.0.3

  • Safer parsing in critical areas, significantly reducing risk of infinite loops
  • Full support for enum declarations
  • Full support for C# modifiers on classes and enums
  • Full support for for loops
  • Added support for multi-variable declarations in a single statement, e.g.:
    int i = 0, i2 = 0;

Version 1.0.4

  • No changes, fixing README.md to display accurate information.

Version 1.0.5

  • No changes, fixing README.md to display accurate information.

Version 1.0.6

  • Full support for switch statements, including:

    • case labels
    • default labels
    • when conditions
  • Full support for goto statements, including:

    • goto case <value>;
    • goto default;
    • goto <Label>; (Label support is planned for a future release)

Version 1.0.7

Minor Update

  • Added support for label declarations (used with goto <Label>;)
    • MyLabel:

Version 1.0.8

Minor Update

  • Fixed class parsing support and resolved infinite loop issues during member parsing.
  • Unified modifier structure across class members, classes, and enums for more consistent AST output.
  • Added validation to disallow const and static modifiers from coexisting on class members, matching C# language rules.
  • Removed old debug logs I forgot to take out

Version 1.0.9

  • No changes, fixing README.md to display accurate information.

Installation Guide

  1. Open a terminal.

  2. Navigate to your project’s root directory:

    cd path/to/your/project
  3. Install the package via npm:

    npm install @isuckatbeingsocial/parse-cs
  4. Build the parser module:

    cd ./node_modules/@isuckatbeingsocial/parse-cs  
    npm install  
    npm run build  
    cd ../../../
  5. Require ParseCS in your project:

    const ParseCS = require('@isuckatbeingsocial/parse-cs');
    const parser = new ParseCS();

Usage

Parsing C# Code

const result = parser.parse(`
public class MyClass
{
    public int myField;

    public void MyMethod()
    {
        // Parsed code goes here.
    }
}
`);

const ast = result.result;

// Alternatively, to access lexer and parser:
const { lexer, parser: innerParser, result: ast2 } = parser.parse('...');

Writing Plugins

const plugins = parser.plugin;

const MyParseCSPlugin = function() {
    return {
        extensions: {
            my_extension: {
                lex: (Lexer) => {
                    // Called for every new lexer using this plugin.
                    Lexer.tokenTypes.push({
                        ignore: true, // If true, the token is not added to the final token list.
                        regex: 'your-regex-here',
                        type: 'MY_TOKEN_TYPE'
                    });

                    // Register custom token type
                    Lexer.constructor.exports.TokenTypes.mytoken = 'MY_TOKEN_TYPE';
                },
                parse: (Parser, TokenTypes) => {
                    Parser.ParseMyToken = function() {
                        this.index(1); // Skip the token
                        return { type: 'MyTokenExpression', value: null };
                    };

                    Parser.expressionExtensions.push(function() {
                        const isMyToken = this.expect(TokenTypes.mytoken, undefined, {
                            throw: false,
                            errorMessage: null
                        });

                        return isMyToken ? Parser.ParseMyToken() : false;
                    });
                }
            }
        }
    };
};

// Register the plugin
plugins.instantiate(MyParseCSPlugin);

You can now parse code with your custom plugin logic enabled.