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

@ottoai/base

v1.0.1

Published

Shareable base configurations for modern node/npm development with typescript, jest and eslint

Readme

Base

Finnish for "start"

So this repo acts as a base - start - module which should be ideally part of every node/npm repo. So we use a consistent base configuration for certain libs we basically use everywhere.

What does it provide

Notable defined versions

| module | version | description | | ---------- | ---------- | ------------------------------------------------------------------------------------------------------ | | node | >=16.0.0 | Actual version, which will go to be LTS version from october 2020 on | | typescript | ~4.3 | Fix version, as typescript isn't strictly following semver. So minor updates can have breaking changes |

How to use

Install using cli

From your project's root directory:

npx @ottoai/base init

💡 If you want to use all of Base's features, you can pass the --all flag

npx @ottoai/base init --all

Note: If any of the files Base uses were already present, Base will create a .bkp file with the existing file. Please make sure to check these files and merge them with the ones Base created or delete them.

Install manually

npm install @ottoai/base --save-dev

As npm prints, make sure to install the peer depedencies.

How to use release

Simple make sure to add a release script to the package.json:

{
  "scripts": {
    "release": "npx standard-version"
  }
}

And then instead of running npm version major|minor|patch run npm run release (similiar with yarn). This will take care of identifying the next version tag based on the conventional commits, creates/updates the CHANGELOG.md, adds everything into a commit and creates the tag. Push the new tag and the commit after that -> done :tada:

How to use eslint config

Simply create a .eslintrc.js file with following content:

const baseConfig = require('@ottoai/base/eslint');

module.exports = {
  ...baseConfig,
};

Add/Update the following script to package.json:

{
  "lint": "eslint --ext .js,.ts \"src/**\""
}

Done! :tada:

Its recommended to create a .eslintignore file with following content

node_modules
dist
coverage
.eslintrc.js
jest.config.js

How to use tsconfig

Simply create a tsconfig.json file with following content:

{
  "extends": "@ottoai/base/tsconfig",
  "include": ["src/**/*"],
  "exclude": ["node_modules", "src/**/*.test.ts"],
  "compilerOptions": {
    "outDir": "dist" // So we get builds in the our current folder :/
  }
}

NOTE: include and exclude aren't shareable and relative to the tsconfig.json where there are defined.

NOTE: This will set "module": "es6", which will make tsc compile to ES Modules instead of CommonJS. If you need to be compatible with CommonJS (node<14), set the following in your tsconfig.json

"compilerOptions": {
  "module": "commonjs"
}

Because this compiles to ES Modules, you should set "type": "module" in your package.json to indicate this to users of your library.

Done! :tada:

How to use jest config

Simply create a jest.config.js file with following content:

const base = require('@ottoai/base/jest.config');

module.exports = {
  ...base,
};

Done! :tada:

Recommendation for scripts in `package.json

{
  "build": "tsc",
  "test": "jest --config jest.config.js",
  "lint": "eslint --ext .js,.ts \"src/**\"",
  "ci": "npm run test -- --coverage && npm run lint && npm run build -- --noEmit",
  "release": "npx standard-version"
}

Local Development

For local development and to try out new configurations the easiest way is to link the module.

Contributing

Do your changes in separate branch and then create a PR to start a discussion. Please add reasons/explanations why certain configurations should be applied basically everywhere.