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

zengenti-make-component

v1.7.1

Published

Generates component boilerplate.

Downloads

29

Readme

Install

Globally for command line usage

npm i -g zengenti-make-component

Locally as a module in your project

npm i zengenti-make-component

TLDRs

  • Set COMPONENT_MAKER_OUTPUT_DIR env var in .env or environmental variables, to set the default output directory.

  • 3 arguments in order: component-name, output-dir, input-dir

  • make-component 2nd and 3rd arguments are in a confusing order, with output folder being the 2nd argument, and input folder the 3rd.

Usage

As a command line tool

make-component

It will then ask you to enter the component name. Make sure to enter it the same way you would write a React component name.

It will then ask you for the input directory. This is the folder which is copied as the boilerplate code, with 'COMPONENT_NAME_HERE' being replaced by the given component name. Press enter for the default structure.

Then it will ask for the output directory. It will pick up the value of COMPONENT_MAKER_OUTPUT_DIR from your .env file or in the environmental variables, otherwise it defaults to the current working directory (cwd). You can type a directory relative to your cwd. Press enter to begin the script.

It should then create the component in the chosen directory with the given component name, using the boilerplate specified by the input folder (defaults to ./bin/structure).

You could alternatively pass the ComponentName, path/to/input, and path/to/output as the first, second, and third arguments to make-component respectively. The component name is required. This is a slightly faster method.

As a node module

const makeComponent = require('zengenti-make-component').default;

makeComponent('NameOfComponent', 'path/to/output');

Output path is optional, it defaults to the cwd.

Troubleshooting

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

  • Make sure to install gnu-sed and alias gsed to sed with:

brew install gnu-sed && PATH="$(brew --prefix)/opt/gnu-sed/libexec/gnubin:$PATH"

Make sure to run PATH="$(brew --prefix)/opt/gnu-sed/libexec/gnubin:$PATH" if the foldername being output is wrong e.g. as LHelloWorld instead of helloWorld

  • Give yourself permission to execute the bash script:

chmod u+x ./bin/maker.sh

  • Install rename:

brew install rename

  • Install npm dependencies

npm install

This should install dotenv and any other npm packages if they are specified in this package.json

Todo

  • Write tests

  • Make it look for a ./structure folder in the cwd and use that as the input folder. Otherwise do default behaviour.

  • Add a --help command

  • Add .env.example

  • Swap input/output arguments of command line version