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

pastry-cli

v1.4.0

Published

Node CLI for effectively pasting template files/directories

Downloads

5

Readme

Pastry-CLI

This CLI aims to help speed up your workflow, guidelines and code reusability by adding support for pasting template building blocks.

Since it's not related to any specific frameworks or languages it can be used everywhere and for anything with minimal setup and full control.

Installation

Install globally with npm npm i -g pastry-cli or yarn yarn global add pastry-cli

Setup/Usage

  1. Create a /pastries directory in your project source directory.
  2. Populate the directory with template files/folders.
  3. Run pastry inside your terminal while located inside your project.

The cli will guide you through the rest of the steps.

It will look up for a /pastries directory starting from your cwd.

This means that you can have default pastries for all projects by placing them in a parent directory.

Name replacement

You can replace any text including filenames with the name you provide when running pastry.

For example: running pastry -n testFile would change the following:

PLACEHOLDER.ts ~> testFile.ts

When changing text inside a file you have more options:

export default PLACEHOLDER' ~> export default testFile

export default UPPER_PLACEHOLDER' ~> export default TESTFILE

export default LOWER_PLACEHOLDER' ~> export default testfile

export default PASCAL_PLACEHOLDER' ~> export default TestFile

Optional Snippets

With optional snippets you can predefine parts of code you might want to use in a file. For example this will prompt you if you want to include the log snippet:

// pastry-start log
console.log('I may be part of the file, yay!')
// pastry-end log

Renaming existing files

By running pastry --rename you can rename existing files. Currently, there is only support to rename together with the parent directory. The name of the directory will be used as PLACEHOLDER is used normally.

Available arguments

| Argument | Shorthand | Description | | ---------- | --------- | --------------------------- | | --name | -n | Define the new name | | --path | -p | Define the target path | | --template | -t | Name of the template to use | | --rename | -r | Rename existing | | --help | -h | List available arguments |

Configuration

Configuration can be done by creating a .pastryconfig.json in the root directory for the project.

{
  "templateDir": "{YOUR_TEMPLATE_DIRECTORY}" // default: pastries
}