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

@classmodel/class

v0.5.0

Published

Chemistry Land-surface Atmosphere Soil Slab (CLASS) model

Readme

@classmodel/class package

github repo badge Code quality npmjs.com Checked with Biome Research Software Directory Badge Documentation

This is an implementation of the Chemistry Land-surface Atmosphere Soil Slab (CLASS) model that runs entirely in the browser or any Javascript runtime like NodeJS.

For more information on CLASS, see https://classmodel.github.io/.

Web application

The CLASS web application that uses this package is available at https://classmodel.github.io/class-web.

Command line usage

The class model can be run from the command line.

# Generate config file with default values
pnpx @classmodel/class generate -o config.json
# Or download one of the presets from
# https://github.com/classmodel/class-web/tree/main/apps/class-solid/src/lib/presets

# Edit the config file

# Run the model
pnpx @classmodel/class run config.json
# Outputs h variable for each timestep in JSON format

# To output csv use
pnpx @classmodel/class run --output output.csv --format csv config.json

# To read from stdin use
cat config.json | pnpx @classmodel/class -

# To get the JSON schema of the config file use
pnpx @classmodel/class schema -o config.schema.json

If you do not have pnpx installed you can use npx instead.

In development use pnpx tsx src/cli.ts ./config.json.

To use the reference configuration of a experiment downloaded from the web application extract it with jq using

jq .reference < ~/Downloads/class-MyExperiment.json  > config.json

Package usage

Install with

pnpm install @classmodel/class

Run model with default config use

import { runClass } from "@classmodel/class/runner";
const config = {}
const output = runClass(config)
console.log(output)

Developers

This package is part of a monorepo with other packages and applications.

JSON schema

The Class model uses a JSON schema to validate the input configuration. The schema is defined in the @classmodel/class package and can be found at src/config.ts (in repo). The schema is used to validate the input configuration and to generate a form to input the configuration.

The src/config.ts file contains the embedded JSON schema and its Typescript type definition.

See the form package for additional keywords in the JSON schema.

Conditional properties

To allow for some properties to be only defined and required when another property is true. We use the if/then/else syntax. The if block should refer to a property in the main properties object. The then block can define additional properties that are required when the if property is true.

See existing Config type in src/config.ts file on how to define the TypeScript type of a new if/then/else block.

Linter

To check types, you can run the pnpm typecheck command as other commands ignore types.

Tests

The unit tests are written with node:test and node:assert.

The unit tests can be run with the following command:

pnpm test

To get test coverage

# Does not work via pnpm script so need to call node directly
node --import tsx --test --experimental-test-coverage --test-reporter=lcov --test-reporter-destination=lcov.info src/*.test.ts
# To generate a html report use genhtml which is part of lcov OS package
genhtml lcov.info --output-directory coverage

API Documentation

The API documention of the package can be generated with

pnpm run docs

Which will write HTML files to docs/ directory.

The documentation of the latest release is published at https://classmodel.github.io/class-web/docs/.

Disclaimer

This project includes code that was generated with the assistance of a language model (LLM). All code generated by the LLM has been reviewed by the development team.