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

file-gen-cli

v3.2.13

Published

A CLI that generate files for your application

Downloads

7

Readme

Build Status CodeFactor npm version BCH compliance License: MIT

Speed up with

Logo

A CLI that generate files for your application

Getting started

  • install globaly with

    npm i file-gen-cli@latest -g

  • Add a folder to hold your templates and gencli.json files

    files templates examples here see bellow for gencli configuration here

  • Register your cli config with

    file-gen-cli register

  • Use your cli with

    file-gen-cli myCliName

  • List clis with

    `file-gen-cli list [tag1] [tag2] ...

  • Deduce templates from a folder

    file-gen-cli deduce <instanceName> [<prefix> <instanceNamePlural>]

How it works

When you use the register parameters, file-gen-cli will lookup in the folder it's being executed for a gencli.json file. It will then save in the cloud this config associeted with the cliName parameters. It will then look each file configs of each entity configs then will look for each of the templates files name in the folder it's being executed. It will then store those file in the cloud associated with the cli name.

You can rewrite the config the same way

When the register is done, and you use file-gen-cli with you cli name as parameter, it will then generate the files.

File gen cli use an heroku hosted server app to manage the configs, see how it works here https://github.com/guignol1981/file-gen-cli-server

Documentation (gencli.json)

General config

| Param | definition | default | required | possible values | | -------------- | ------------------------------------- | ------- | -------- | ------------------------------------- | | cliName | name of your cli | | true | a string with no spaces | | description | desc of your config (for public list) | | true | | | token | a jwt to generate new config | | true | contact me to get a token | | fileNameCase | the case of the files name | kebab | false | kebab, camel, pascal, constant, snake | | folderNameCase | the case of the folders name | kebab | false | kebab, camel, pascal, constant, snake | | entityConfigs | an array of entity configs | | true | see Entity config bellow |

Entity config

| Param | definition | default | required | possible values | | ------------ | ------------------------------------------------------------ | ------- | -------- | --------------- | | name | the entity name | | true | | | prefix | the entity prefix that can occur in different files template | | false | | | fileConfigs | an array of file configs | | true | | | singularOnly | if there is only singular name occurence in templates | false | false | | | flat | determine if the cli should create a folder for the instance | false | false | |

File config

| Param | definition | default | required | possible values | | -------- | ------------------------------------------------------------------------ | ------- | -------- | --------------- | | name | the file name (the * symbole is replaced by the entity instance name) | | true | | | template | the template name for the file (no template will generate an empty file) | | false | | | path | path to create the file relative to the instance path | ./ | false | |

Templates

| keywords (* = supported cases) | replaced with | | ------------------------------- | ------------------------------------------------- | | {{SINGULAR_}} | instance name with specified case | | {{PLURAL_}} | instance plural name with specified case | | {{PREFIXED_SINGULAR_}} | instance prefixed name with specified case | | {{PREFIXED_PLURAL_}} | instance prefixed plural name with specified case |

Supported Cases

CAMEL, CAPITAL, CONSTANT, DOT, HEADER, NO, KEBAB (deprecate, use PARAM) PARAM, PASCAL, PATH, SENTENCE, SNAKE,

TODO (feel free to help)

  • Convert to Typescript

Contributing

  • Feel free to suggest features, submit issues or update the documentation!

Contributors

  • Contribute and add your name here!

License

  • Copyright (c) 2019 Vincent Guillemette (github: guignol1981) Licensed under the MIT license.