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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@nyren/codebase-setup

v0.2.2

Published

A CLI tool designed to streamline project setup for JavaScript and TypeScript, providing essential libraries and configurations for quick initialization and efficient workflows.

Downloads

36

Readme

@nyren/codebase-setup

A CLI tool that simplifies setting up codebases for JavaScript or TypeScript projects. It provides essential libraries and configurations for rapid project initialization.

Features

  • Supports both JavaScript and TypeScript: Choose between JavaScript or TypeScript during setup.
  • Pre-configured libraries: Automatically adds useful libraries based on the chosen language.
  • Simple project structure: Sets up a basic but powerful project structure, allowing you to get started quickly.
  • Configurable options: Offers flexibility to modify the setup process according to your preferences.

Note: This project does not provide any API for direct usage. It is solely a CLI tool designed for project setup.

Installation

You can install the CLI globally via npm:

npm install -g @nyren/codebase-setup

Or with Bun:

bun add -g @nyren/codebase-setup

Usage

After installation, you can use the CLI to set up a new project:

nyrenx-codeup init

The CLI will guide you through a series of prompts, where you can choose the project language and other options.

Commands

  • init: Initializes a new project with the selected language and configuration.

Dev Dependencies

For TypeScript Projects

When you choose TypeScript, the following devDependencies will be added automatically:

{
  "dependencies": {
    "tslib": "^2.7.0"
  },
  "devDependencies": {
    "@nyren/codebase-setup": "^0.2.2",
    "@jest/globals": "^29.7.0",
    "@types/jest": "^29.5.13",
    "@types/node": "^22.7.4",
    "jest": "^29.7.0",
    "prettier": "^3.3.3",
    "ts-jest": "^29.2.5",
    "ts-node": "^10.9.2",
    "typescript": "^5.6.2"
  }
}

For JavaScript Projects

If you choose JavaScript, the following minimal devDependencies will be installed:

{
  "devDependencies": {
    "jest": "^29.7.0",
    "prettier": "^3.3.3",
    "nodemon": "^2.0.22"
  }
}

Both setups ensure you have the necessary tools to start developing with either JavaScript or TypeScript.

TypeScript Configuration

When setting up a TypeScript project, @nyren/codebase-setup provides two options for tsconfig based on the module system you choose:

  1. CommonJS: If you choose CommonJS, the tool will use the following configuration:

    • @nyren/codebase-setup/tsconfigs/cjs.json
  2. ESModule: If you choose ES Module, the tool will use the following configuration:

    • @nyren/codebase-setup/tsconfigs/esm.json

Base Configuration

Both configurations extend from a base setup with the following settings:

{
  "compilerOptions": {
    "target": "es2022",
    "module": "Node16",
    "declarationDir": "lib/types",
    "moduleResolution": "Node16",
    "lib": [
      "es2022"
    ],
    "baseUrl": ".",
    "strict": true,
    "sourceMap": true,
    "declaration": true,
    "declarationMap": true,
    "importHelpers": true,
    "allowSyntheticDefaultImports": false,
    "allowUnreachableCode": false,
    "esModuleInterop": false,
    "noFallthroughCasesInSwitch": true,
    "noImplicitReturns": true,
    "noUncheckedIndexedAccess": false,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "useDefineForClassFields": true,
    "forceConsistentCasingInFileNames": true
  },
  "include": ["src", "src/**/*.ts"],
  "exclude": ["node_modules"]
}

Example Workflow

  1. Choose the language for your project (JavaScript or TypeScript).
  2. Automatically install essential libraries for the selected language.
  3. Enjoy your new project, fully set up with the necessary tools!

Options

The following options are available during project setup:

  • JavaScript/TypeScript: Select the programming language.
  • Libraries: Add useful libraries for the chosen language.
  • Project Structure: Automatically create a basic structure optimized for your choice.

Roadmap

  • Additional integrations with popular frameworks.
  • Customizable project templates.
  • Support for more languages and tools.

License

MIT License. See LICENSE for more details.