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

@agelesscoding/cli

v1.0.11

Published

Ageless Coding Core - cli

Downloads

74

Readme

@agelesscoding/cli

NPM Version NPM License npm Downloads

Screen Shot

Tip: In the scaffolding's interactive interface, you can choose the built-in project template, or choose to develop a template yourself. Then, wait for the scaffolding to install the template to your project directory, and you can start development.

Quick Start

First, you need to install the scaffolding globally:

$ npm install -g @agelesscoding/cli

Then, you can use the agelesscoding or agc command to create a project:

$ mkdir demo && cd demo
$ agc init # or agc init [projectName]

Create your project by local template configuration file

Assuming that your template configuration file is located locally at /Users/<username>/template/configuration/file/templates.json, you can create a new template project using the following command:

$ agc init -ltcp /Users/<username>/template/configuration/file/templates.json

Create your project by remote template configuration file

Assuming that your template configuration file address is: https://cdn.jsdelivr.net/gh/agelesscoding/cli-template@main/templates.json, you can create a new template project using the following command:

$ agc init -rtcp https://cdn.jsdelivr.net/gh/agelesscoding/cli-template@main/templates.json

Config the templates.json file

The templates.json file is the configuration file of the project/component library, which is used to configure the template information of the project/component library, including the template name, template description, template address, etc. The following is an explanation of the fields in the configuration file:

  • name.en: The English name of the template, required, used to display in the command line.
  • name.zh_CN: The Chinese name of the template, required, used to display in the command line.
  • npmName: The npm package name of the template, required. When you select the template to create, the scaffolding will download the template from the npm repository.
  • version: The version number of the template, optional.
  • type: The type of the template, required. The optional value is: normal, custom. The default value is: normal. normal means that the template is a standard template, and custom means that the template is a custom template.
  • installCommand: The installation command of the template, optional. When this field value is provided, the scaffolding will execute this command to install the template dependency after downloading the template.
  • startCommand: The start command of the template, optional. When this field value is provided, the scaffolding will execute this command to start the template after installing the template dependency.
  • tag: The tag of the template, required. The optional value is: ['project'], ['component']. The default value is: ['project']. ['project'] means that the template is a project template, and ['component'] means that the template is a component library template.
  • ignore: The ignore files of the template, optional. This field is special. When your template has third-party ejs template files, you must configure this field to ignore those third-party ejs template files. Because those ejs template files will conflict with the ejs template files in the scaffolding, causing the scaffolding to fail to run normally. The value of this field is an array, and each item in the array is a regular expression used to match the files that need to be ignored. For example: ["**/public/**"].

Here is a built-in template repository, you can refer to the configuration file of this repository: @agelesscoding/cli-template

How to develop your own template?

  1. Create a folder named demo in some directory, and enter the demo directory.
    $ mkdir demo && cd demo
  2. Initialize the project.
    $ npm init -y
  3. Create a folder named template in the demo directory, and create a configuration file named templates.json in the demo directory. The content of the templates.json file like this: @agelesscoding/cli-template.
  4. Now, you can develop your own template in the template directory. When you finish the development, you can publish your template to the npm repository.
    $ npm publish
  5. Finally, you can use the agelesscoding or agc command to create a project using your own template.
    $ mkdir test-project && cd test-project
    $ agc init -ltcp /demo/template/path/templates.json

Local Develop

  1. Enter the /core/cli directory and execute npm link, which will register the scaffolding globally.
  2. In vscode, click debug to enter the debugging mode, and debug the execution process of the local cli.

Happy coding ;-)