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

boiler-dev

v0.34.0

Published

Boilerplate generator framework & low-code power tool 🛠️

Downloads

40

Readme

boiler

Boilerplate generator framework & low-code power tool 🛠️

npm install -g boiler-dev

Generator lifecycle

| Action | Command | | ------------------------------ | ----------------------------------------- | | Start a new TypeScript project | boiler new [project-name] | | Change directory to project | cd [project-name] | | Install and run generator | boiler generate [git url] | | Update generator | boiler update [boiler/generator-name] | | Regenerate installed generator | boiler generate [boiler/generator-name] | | Create new generator | boiler new [boiler/generator-name] | | Commit and push generator | boiler commit [boiler/generator-name] | | Status of generator repos | boiler status [boiler/generator-name] |

When commands are run without arguments, it will run across all installed generators.

For successive generate calls, boiler will regenerate with saved user input unless the --new flag is specified.

Important files

| Path | Description | | -------------- | ---------------------------------------------------------- | | .boiler.json | Record of generator runs, with version and user input data | | boiler/ | Installed generator repos |

Usage examples

Install boiler

npm install -g boiler-dev

Run generator

  1. cd to your project
  2. boiler generate [git repo]

The generate command automatically installs new generators.

Generator repos are cloned to the boiler directory within your project. The boiler directory is like node_modules for your generators.

ℹ️ Explore example generators on the boiler-dev GitHub org.

Update and regenerate

  1. cd to your project
  2. boiler update [boiler/my-generator]
  3. boiler generate [boiler/my-generator]

New generator

  1. cd to your project
  2. boiler new boiler/my-generator

Develop generator

  1. Modify boiler/my-generator/boiler.ts (see next section for API details)
  2. boiler generate boiler/my-generator
  3. boiler commit boiler/my-generator "First commit"

Generator API — boiler.ts

Each generator repo must have a boiler.ts or boiler.js file:

import {
  InstallBoiler,
  PromptBoiler,
  GenerateBoiler,
  UninstallBoiler,
} from "boiler-dev"

export const install: InstallBoiler = async ({
  files,
  rootDirPath,
}) => {}

export const prompt: PromptBoiler = async ({
  files,
  rootDirPath,
}) => {
  const prompts = []
  return prompts
}

export const generate: GenerateBoiler = async ({
  answers,
  files,
  rootDirPath,
}) => {
  const actions = []
  return actions
}

export const uninstall: UninstallBoiler = async ({
  answers,
  files,
  rootDirPath,
}) => {}

Prompt

The prompt function returns an array of "prompts" that define user input to retrieve.

Prompts are essentially an array of Inquirer.js Questions.

Generate

The generate function returns an array of "actions" necessary to install the boilerplate.

Actions are a convenience; feel free to run your own async code within installBoiler and return nothing.

Write file action

actions.push({
  action: "write",
  path: "bin/hi",
  source: "#!/usr/bin/env node",
  bin: true,
})

ℹ️ The bin option runs chmod +x on the file.

Merge JSON action

actions.push({
  action: "merge",
  path: "package.json",
  source: { hi: true },
})

ℹ️ The merge functionality comes from deepmerge.

NPM install action

actions.push({
  action: "npmInstall",
  source: ["typescript"],
  dev: true,
})

New project

When not used within a boiler/ directory, the boiler new command creates a new TypeScript project to kick things off:

boiler new my-project

ℹ️ This is a shortcut for manually running the following generators: