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

@lundiak/react-sum

v1.4.4

Published

Experimental ReactJS component to show sum of 2 numbers.

Readme

React Sum

Experimental ReactJS component to show sum of 2 numbers. There is no reasonable purpose to use this component by anyone but me :)

Experiment related to Component creation process and usage of tools, such as: npm/yarn, ESLINT, Webpack, Babel, Create React App, CSS Modules (migrated from LESS) React Scripts, Storybook, Jest, Enzyme, Cucumber and CI tool Circle CI.

pages-build-deployment

npm version

Consumer Usage

Installation

  • yarn add @lundiak/react-sum
  • npm install --save @lundiak/react-sum

Usage

Import the component where you want to use it, and you ready to use it.

  • import ReactSum from '@lundiak/react-sum' for <ReactSum.Sum /> usage.

or

  • import { Sum } from '@lundiak/react-sum'; for <Sum /> usage.

Props

| Prop | Description | Default value | | ------ | :-----------: | :-------------: | | a | a | undefined | | b | b | undefined |

Optional props

| Prop | Description | Default value | | --------- | :-----------------------------------: | :-------------: | | useImages | renders Sum sign as Image | false | | useASCII | renders Sum sign as ASCII Math symbol | false |

Example

How to add to your file MyApp.jsx:

import { Sum } from "@lundiak/react-sum";

export const MyApp = () => {
  return <Sum a={2} b={3} />;
};

Using types

If component Sum is imported, then such line will cause TypeScript warnings about required params a and b.

const Test = () => <Sum />;

To look up what is actual typings, this code will be OK:

import { Sum } from "@lundiak/react-sum";
import type { SumProps } from "@lundiak/react-sum/types/components/sum/common";

interface MyData {
  data: SumProps;
}
export const MySumExample = (props: MyData) => {
  return (
    <div>
      <Sum a={props.data.a} b={props.data.b} />
    </div>
  );
};

Development

2025

  • Decided to use only npm
  • Upgraded to latest React v19.x
  • Migrated from CRA + react-scripts to Vite
    • Also migrated to Vitest maybe partially with @testing-library/react. Used hints from here.
    • Also migrated jest-cucumber to @amiceli/vitest-cucumber to work with vitest
  • Migrated to ESLINT v9 (via npm init @eslint/config@latest) - guide
  • And also added @vitest/eslint-plugin (because legacy eslint-plugin-vitest refers to eslint v8).
  • Re-Bootstrap with npm create vite@latest
  • Replaced old Storybook approach by new Ladle :)
  • As of July-2025 ascii-math remains built as pure JavaScript referring deep inside to MathML. And for TypeScript project there is no typings.
    • So I created ascii-math.d.ts => declare module "ascii-math"; to suppress TypeScript error.
  • Added usage of alternative asciimath-parser with KaTeX aka katex
    • but KaTeX brings lot of fonts into dist after npm run build
  • Maybe https://www.mathjax.org/#gettingstarted - https://github.com/mathjax/MathJax - (High-quality display of LaTeX, MathML, and AsciiMath notation in HTML pages)
    • but looks CommonJS-oriented and last updated in 2022. Not ESM-ready (only es5).
  • Exported typings (enabled declaration in tsconfig to expose *.d.ts files for external codebase imports)

2021

README