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

dkcutter

v4.1.4

Published

A command-line utility that creates projects from templates.

Downloads

571

Readme

dkcutter

A command-line utility that creates projects from templates.

license mit NPM version

Overview

DKCutter takes a template provided as a directory structure with template-files. Templates can be located on the file system, such as on a VCS (Git) server like GitHub.

It reads a settings file and interactively prompts the user whether or not to change the settings.

It then takes both and generates an output directory structure from them.

Additionally, the model can provide code (Javascript, Typescript) to be executed before and after generation (pre-generation and post-generation hooks).

Input

This is a directory structure for a simple dkcutter:

dkcutter-something/
├── template/
│   ├── {{dkcutter.projectSlug}}/  <----- Project template
├── hooks/                         <----- JavaScript to be executed before and after generation
│   ├── preGenProject.js           <----- can also be `.ts`
│   └── postGenProject.js          <----- can also be `.ts`
├── blah.txt                       <----- Non-templated files/dirs go outside
│
└── dkcutter.json                  <----- Prompts & default values

You must have:

  • A dkcutter.json file
  • A template/{{dkcutter.projectSlug}}/ directory, where projectSlug is defined in your dkcutter.json.

Beyond that, you can have whatever files/directories you want.

Output

This is what will be generated locally, in your current directory:

mysomething/    <-------- Value corresponding to what you enter at the
│                         projectSlug prompt
│
└── ...         <-------- Files corresponding to those in your
                          dkcutter's `{{ dkcutter.projectSlug }}/` dir

Getting Started

For Users

The recommended way to use DKCutter as a command line utility is to execute it with pnpm dlx, npx, yarn dlx or bunx.

Use a GitHub template

pnpm dlx dkcutter https://github.com/dkshs/dkcutter-nextjs.git

Use a local template

pnpm dlx dkcutter ./dkcutter-nextjs

Detailed Usage

  • Generate projects from local or remote templates.
  • Customize projects with dkcutter.json prompts.
  • Utilize pre- and post-generate hooks.

Learn More

For Template Creators

  • Utilize unlimited directory nesting.
  • Employ nunjucks for all templating needs.
  • Define template variables easily with dkcutter.json.

Learn More

References and inspirations

  • Cookiecutter - A cross-platform command-line utility that creates projects from project templates, e.g. Python package projects, C projects.

License

This project is licensed under the MIT License - see the LICENSE file for details