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

@nikovirtala/projen-constructs

v0.2.27

Published

Projen project types with standard configuration

Readme

@nikovirtala/projen-constructs

Projen project types with standard configuration for consistent project setup across all repositories.

Installation

pnpm add -D @nikovirtala/projen-constructs projen constructs

Features

  • Standard Configuration: Opinionated defaults for author, release branch, package manager, Node.js, TypeScript, and tooling
  • Automatic Project Type Discovery: Generates ProjectType enum from Projen's JSII manifest (18 project types)
  • Component System: Reusable components (Vitest, Mise, TypeDoc, LocalStack, etc.)
  • Code Generation: ProjectGenerator creates project classes with standard configuration
  • ES Modules: TypeScript and CDK App projects use ES modules (JSII uses CommonJS)
  • Code Quality: Biome for formatting and linting
  • Testing: Vitest with coverage
  • Auto-merge: Enabled with auto-approve
  • VSCode: Recommended extensions and settings
  • mise: Node version management

Standard Configuration

  • Author: Niko Virtala ([email protected])
  • Default Release Branch: main
  • Package Manager: pnpm 10
  • Node Version: 22.21.1
  • TypeScript: 5.9.3
  • CDK Version: 2.223.0 (for CDK projects)
  • JSII Version: ~5.9.3 (for JSII projects)

Customization

Override any option by passing it to the constructor:

const project = new JsiiProject({
  name: "my-project",
  repositoryUrl: "https://github.com/nikovirtala/my-project.git",
  minNodeVersion: "20.0.0",
  author: "Custom Author",
  authorAddress: "[email protected]",
  mise: false,
  vitest: false,
  tsconfig: {
    compilerOptions: {
      noUnusedLocals: false,
    },
  },
  biomeOptions: {
    biomeConfig: {
      formatter: {
        lineWidth: 100,
      },
    },
  },
});

Usage

Projects

AWS CDK Construct Library Project

import { AwsCdkConstructLibraryProject } from "@nikovirtala/projen-constructs";

const project = new AwsCdkConstructLibraryProject({
  name: "my-cdk-construct",
  repositoryUrl: "https://github.com/nikovirtala/my-cdk-construct.git",
});

project.synth();

AWS CDK TypeScript App Project

import { AwsCdkTypeScriptAppProject } from "@nikovirtala/projen-constructs";

const project = new AwsCdkTypeScriptAppProject({
  name: "my-cdk-app",
  repositoryUrl: "https://github.com/nikovirtala/my-cdk-app.git",
});

project.synth();

JSII Project

import { JsiiProject } from "@nikovirtala/projen-constructs";

const project = new JsiiProject({
  name: "my-jsii-project",
  repositoryUrl: "https://github.com/nikovirtala/my-jsii-project.git",
});

project.synth();

TypeScript Project

import { TypeScriptProject } from "@nikovirtala/projen-constructs";

const project = new TypeScriptProject({
  name: "my-typescript-project",
  repositoryUrl: "https://github.com/nikovirtala/my-typescript-project.git",
});

project.synth();

Components

The package includes reusable components for common development tasks:

Vitest

Vitest testing framework component.

import { Vitest } from "@nikovirtala/projen-constructs";

new Vitest(project, {
  vitestVersion: "^4",
  config: {
    coverageProvider: CoverageProvider.V8,
    coverageReporters: [CoverageReporter.TEXT, CoverageReporter.LCOV],
  },
});

TypeDoc

TypeDoc documentation generation component.

import { TypeDoc, EntryPointStrategy } from "@nikovirtala/projen-constructs";

new TypeDoc(project, {
  version: "^0.28",
  typeDocConfig: {
    entryPointStrategy: EntryPointStrategy.EXPAND,
    out: "docs/api",
    exclude: ["**/*.test.ts"],
  },
});

Mise

Mise dev tools/runtimes management component.

import { Mise } from "@nikovirtala/projen-constructs";

new Mise(project, {
  nodeVersion: "22.21.1",
});

Homebrew

Homebrew package management component.

import { Homebrew } from "@nikovirtala/projen-constructs";

const homebrew = new Homebrew(project, {
  packages: ["jq", "yq"],
});

homebrew.addPackage("gh");

Colima

Colima container runtime component. Alternative for Docker.

import { Colima } from "@nikovirtala/projen-constructs";

new Colima(project);

LocalStack

LocalStack AWS emulation component.

import { LocalStack } from "@nikovirtala/projen-constructs";

new LocalStack(project, {
  services: ["s3", "lambda", "dynamodb"],
  port: 4566,
  debug: true,
});

LambdaFunctionConstructGenerator

Generates AWS CDK Lambda Function constructs and bundles their code.

import { LambdaFunctionConstructGenerator } from "@nikovirtala/projen-constructs";

new LambdaFunctionConstructGenerator(project, {
  sourceDir: "src/handlers",
  outputDir: "src/constructs/lambda",
  filePattern: "*.lambda.ts",
  esbuildOptions: {
    minify: true,
    sourcemap: true,
  },
});

Bundler

Low-level bundling utilities for Lambda functions.

import {
  Bundler,
  LambdaFunctionCodeBundle,
} from "@nikovirtala/projen-constructs";

const bundler = new Bundler(project, {
  assetsDir: "assets",
  esbuildVersion: "^0.25",
});

new LambdaFunctionCodeBundle(project, {
  entrypoint: "src/my-function.lambda.ts",
  extension: ".lambda.ts",
});

ProjectGenerator

Generates TypeScript project classes with standard configuration.

import { ProjectGenerator, ProjectType } from "@nikovirtala/projen-constructs";

new ProjectGenerator(project, {
  name: "TypeScriptProject",
  projectType: ProjectType.TYPESCRIPT,
  filePath: "./src/projects/typescript.generated.ts",
  components: [
    { componentClass: Mise },
    { componentClass: Vitest }, // Auto-detects VitestOptions from JSII manifest
  ],
});

Features:

  • Automatically generates the ProjectType enum from Projen's JSII manifest
  • Auto-detects component options types from JSII manifests
  • Validates paths to prevent directory traversal attacks
  • Structured error handling with custom error classes