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

@cliffpyles/blueprints-cli

v1.14.2

Published

A tool for generating predefined files and directories

Downloads

53

Readme

blueprints-cli

(work in progress. USE AT OWN RISK. api, features, and conventions are likely to change)

(docs not complete)

blueprints-cli is a tool for generating files (i.e. blueprint instances) based on templates (i.e. blueprints). One common usage for this tool is generating files for development environments (ex. components, applications, containers, configurations, etc.)

The goal of the project is the automation of file creation, with simplicity, flexibility, and extensibility in mind.

Installation

npm install -g @cliffpyles/blueprints-cli

or

yarn global add @cliffpyles/blueprints-cli

Quick Start

1) Create a blueprint

bp new -g ExampleBlueprint

2) Configure the blueprint

Place files you want to reuse in ~/.blueprints/ExampleBlueprint/files/

3) Use the blueprint

Go to the desired folder and run bp generate ExampleBlueprint MyInstance

Commands

generate|g [options] <blueprint> <blueprintInstance> Generate files with a blueprint

list|ls [namespace] List all available blueprints

new [options] <blueprint> Create a blueprint

import <globalBlueprint> [localBlueprint] Create a project blueprint based on a global blueprint

init [projectPath] Initialize a local blueprints project

remove|rm [options] <blueprint> Remove a blueprint

help [command] display help for command

How it Works

blueprint-cli uses the concept of global and local blueprints. To modify your global blueprints go to ~/.blueprints. To modify your project blueprints go to your/project/path/.blueprints. A blueprint is by definition a directory that is a descendant of a .blueprints directory. You can use a blueprint to generate a blueprint instance.

Generating a Blueprint Instance

You can use a blueprint to create a blueprint instance. This creation is referred to as generating a blueprint instance.

You can think of generating a blueprint instance, as copying and pasting a directory, followed by some optional file and directory modifications. The directory you copy is the blueprint, the directory created when you paste is the blueprint instance.

You generate a blueprint instance by running: bp generate <blueprintName> <blueprintInstanceName>

When generating blueprint instances, the tool will look for the blueprint in your current directory first, and then it will look in every parent directory, until it reaches your home directory. It will use the first blueprint it finds, unless you expicitly tell it to use the global blueprint (the blueprint in the home directory).

Blueprint Structure

├── blueprint.json
├── files/
├── hooks.js

blueprint.json

A file placed at the root of a blueprint. The contents of the this file allow for further configuration of a blueprint.

Properties

description - A description of the blueprint. Used to describe what the blueprint is when you run bp list

data - Default data values that will be used when generating a blueprint instance. The data can be used to rename files and directories, or to replace file contents. These values can be overwritten by specifying the values when the generate command is run.

files/

A directory containing the files and directories that will be copied during blueprint instance generation.

hooks.js

A node module that exports various functions that are executed during blueprint instance generation.