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

c5-code-editor

v0.0.3

Published

This is a small utility that allows displaying source code nicely in a react app.

Readme

c5-code-editor

This is a small utility that allows displaying source code nicely in a react app.

To install:

  npm install c5-code-editor

Sample usage:

import React, { useState } from 'react';
import Editor, { findColor } from 'c5-code-editor';

const App = () => {
  const [code, setCode] = useState(`import React from 'react'
  const App = (a) => {
    return (
      <div className="main-div">
        <h2>Hello world</h2>
      </div>
    )
  }`);

  return <Editor code={code} />;
};

Props: | Prop Name | optional | type | description | | :---------- | :-------- | :-------- | :---------- | | code | [required] | string | the code you want displayed | | showLineNumbers | [✔] | boolean | show line numbers or not. Defaults to true. | | codeElem | [✔] | string | color for the code elements | | enableCodeElem | [✔] | boolean | color code elements or not. Defaults to true. | | codeStr | [✔] | string | color of strings inside double quotes | | enableCodeStr | [✔] | boolean | color code string or not. Defaults to true. | | codeQuote | [✔] | string | color of quotation marks | | enableCodeQuote | [✔] | boolean | color quotation marks or not. Defaults to true. | | reserved | [✔] | string | color of reserved words | | enableReserved | [✔] | boolean | color reserved words or not. Defaults to true. | | appColor | [✔] | string | color of app like words | | enableAppColor | [✔] | boolean | color app like words or not. Defaults to true. | | defaultColor | [✔] | string | color of default like words | | enableDefaultColor | [✔] | boolean | color default like words or not | | codeSingle | [✔] | string | color of single quotes | | enableCodeSingle | [✔] | boolean | color single quotes or not. Defaults to true. | | betweenSingleQuotes | [✔] | string | color of contents between single quotes | | enableBetweenSingleQuotes | [✔] | boolean | color contents between single quotes or not. Defaults to true. | | parens | [✔] | string | color of parenthesis | | enableParens | [✔] | boolean | color parenthesis or not. Defaults to true. | | insideParens | [✔] | string | color of contents inside of parenthesis | | enableInsideParens | [✔] | boolean | color contents inside of parenthesis or not. Defaults to true. | | alternates | [✔] | string | color of alternate words | | enableAlternates | [✔] | boolean | color alternate words or not. Defaults to true. | | customReserveWords | [✔] | array of strings | an array of words that you would like to include in the coloring of reserve words. defaults to empty array | | customAppWords | [✔] | array of strings | an array of words that you would like to include in the coloring of app words. defaults to empty array | | customDefaults | [✔] | array of strings | an array of words that you would like to include in the coloring of default words. defaults to empty array | | customAlternatives | [✔] | array of strings | an array of words that you would like to include in the coloring of alternative words. defaults to empty array | | parserType | [✔] | string | type of parser to use with Prettier to format the code string. Defaults to 'babel' | | format | [✔] | boolean | format code or not. defaults to true

words list:

export const reservedWords: string[] = [
  'id',
  'className',
  'class',
  'if',
  'then',
  'json',
  'application',
  'method',
  'async',
  'await',
  'for',
];

export const defaultWords: string[] = [
  'return',
  'import',
  'console',
  'log',
  'from',
];

export const appWords: string[] = [
  'React',
  'Axios',
  'const',
  'function',
  'let',
  'var',
  'avion',
];

export const alternateWords: string[] = ['url', 'params', 'data', 'cors'];

Parser Types:

export type Parsers =
  | 'babel'
  | 'css'
  | 'json'
  | 'flow'
  | 'babel-flow'
  | 'babel-ts'
  | 'typescript'
  | 'json'
  | 'markdown'
  | 'html';