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

create-project-files-cli

v1.2.0

Published

Create your project files faster using a CLI

Downloads

3

Readme


Create your project files faster using this CLI. You can create file templates and, with one command, create copies of your templates in the folder you want.

  • :white_check_mark: Faster and easier than code snippets
  • :white_check_mark: You can add the template files in the version control system
  • :white_check_mark: Rename template files and folders
  • :white_check_mark: Replace text inside your template files
  • :white_check_mark: Use this library in JavaScript code

:zap: Installation

Installing Globally

yarn global add create-project-files-cli
npm i -g create-project-files-cli

Installing as Dev Dependency

yarn add -D create-project-files-cli
npm i -D create-project-files-cli

:point_right: Getting Started

Follow the steps below to learn how to use this library.

  1. Create a folder called __file-templates__ in the root folder of your project.
  2. Create a file called test.txt in the __file-templates__ folder.
  3. Open a terminal and type cpf create text.txt .
  4. Now you should see a file called text.txt in your root folder.

:page_facing_up: Documentation

  • :large_blue_circle: cpf create <source> <destination> [options]

Creates a file or folder based on the <source> at <destination>.

| Option | Description | Example | | ----------------------------------------- | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------- | | -n, --name <name> | Changes the name of a file or folder. | cpf create text.txt src -n newName.txt | | -t, --templates-folder <path> | Path to templates folder. | cpf create text.txt src -t my-templates | | -e, --encoding <encoding> | Changes the content encoding of the read files. | cpf create text.txt src -e base64 | | -rn, --replace-names <names...> | Replaces the names of a file or folder. | cpf create [fileName].txt src -rn fileName=myFile | | -nb, --no-brackets | Makes brackets not required when using the --replace-names option. | cpf create fileName.txt src -rn fileName=otherFile -nb | | -rc, --replace-content <content...> | Replaces parts of the contents of a file or files within a folder. | cpf create text.txt src -rc file=myFile | | -kvs, --key-value-separator <separator> | Defines a custom key-value separator for the --replace-names and --replace-content options. | cpf create [fileName].txt src -rn fileName@myFile -kvs "@" |

  • :large_blue_circle: cpf help [command]

Display the help for a command or all commands.

:computer: Using in Code

You can use the library in code if your using the version 1.1.0 or greater. You can install as dev dependency, create a javascript file, and do something like the example below:

const { CreateCommand } = require('create-project-files-cli')

const command = new CreateCommand('text.txt', '.', {
  // Options ...
})

const results = command.run()

console.log(results)

:hourglass: Coming Soon

  • Support for multiple template folders.
  • Create multiple files and folders with only one command.
  • Ignore case when replacing the content of a file.
  • Set an alias to a file or folder inside the templates folder.
  • Config file to simplify the use of this library.
  • --silent option to run the CLI silently.
  • Add uuid or timestamp to file names.
  • Create destination folder if not exists.
  • --force option to delete existing files and folders to create the new ones.

:handshake: Contributing

:star: This project can be better with your help :star:

:man: Author

Created with :heart: by Luan Eduardo da Costa | Follow me on Linkedin