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

alias-kitchen

v0.2.4

Published

Single source of truth for your project's alias configuration

Readme

types included npm version npm downloads npm bundle size

Alias Kitchen

Alias Kitchen logo

Alias Kitchen provides developers an ability to have a single source of truth regarding project import aliases.

The problem

Are you tired of writing import {Foo} from './../../../../../bar/bazz/Foo' and then changing it every time you move a file? Do you wish you had a single, reliable source of truth for your project's internal links, seamlessly integrated across all your favorite bundlers?

The solution

Alias Kitchen is here to help!

Set paths property inside your tsconfig.json or jsconfig.json.

{
    "compilerOptions": {
        "paths": {
            "@/components/*": ["./src/components/*"],
            "@/features/*": ["./src/features/*"]
        }
    }
}

And then apply the same configuration to your bundlers using alias-kitchen. Vite, Rollup, Webpack, Rspack, Jest and so on.

From now on, you can use the same import address everywhere.

import {Button} from '@/components/Button';

Installation

npm i -D alias-kitchen

Usage with bundlers

alias-kitchen provides a utility function kitchen which allows a developer to choose which recipe of alias config they are going to use.

import {kitchen} from 'alias-kitchen';

const aliasConfig = kitchen({recipe: 'rollup'});

Alias names and paths are picked from compilerOptions.paths property of TypeScript config file (tsconfig.json). You can set a custom file name and path to look up.

import {kitchen} from 'alias-kitchen';

const aliasConfig = kitchen({
    configName: 'jsconfig.json',
    searchPath: '/your/project/path'
});

Rollup

With @rollup/plugin-alias.

// rollup.config.js
import alias from '@rollup/plugin-alias';
import {kitchen} from 'alias-kitchen';

export default {
    //...
    plugins: [
        alias({
            entries: kitchen({recipe: 'rollup'}),
        }),
    ],
};

Vite

// vite.config.ts
import {defineConfig} from 'vite';
import {kitchen} from 'alias-kitchen';

export default defineConfig({
    //...
    resolve: {
        alias: kitchen({recipe: 'vite'}),
    }
})

Babel

With babel-plugin-module-resolver.

// babel.config.js
const {kitchen} = require('alias-kitchen');

module.exports = {
    //...
    plugins: [
        [
            'babel-plugin-module-resolver',
            {
                alias: kitchen({recipe: 'babel'}),
            },
        ],
    ],
};

Webpack

// webpack.config.js
const {kitchen} = require('alias-kitchen');

module.exports = {
    //...
    resolve: {
        alias: kitchen({recipe: 'webpack'}),
    },
};

Rspack

// rspack.config.ts
import {defineConfig} from '@rspack/cli';
import {kitchen} from 'alias-kitchen';

export default defineConfig({
    //...
    resolve: {
        alias: kitchen({recipe: 'rspack'}),
    },
});

Jest

// jest.config.ts
import {kitchen} from 'alias-kitchen';

export default {
    //...
    moduleNameMapper: {
        //...
        ...kitchen({recipe: 'jest'}),
    },
};

Add custom recipe function

Developers can provide their own recipe functions to get desired output

import path from 'node:path';
import {kitchen} from 'alias-kitchen';

// produces array of aliases with relative paths resolved to absolute
const customRecipe = (normalizedPaths) => {
    return normalizedPaths.map(([alias, directory]) => [
        alias,
        path.resolve(directory),
    ]);
};

const aliasConfig = kitchen({recipe: customRecipe});