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

yamlscript

v1.0.5

Published

An easy to use npm package that let you write and run command line scripts in a yaml format

Downloads

27

Readme

yamlscript

An easy to use npm package that lets you write and run command line scripts in a yaml format. You can define which commands run in series and which commands run in parallel.

It let you load scripts to be used again and also creates a log file for each run for tracking.

Installation

npm i -g yamlscript

Script Format

You have to write the commands in a yaml format as a list of dictionaries, where the value of a key named c (required) of each dictionary is the command, value of a key named title (optional) is the title of the command, and the value of a key named next (optional) is the next set of commands that will be excuted after the command finishes.

Example of the yaml script file

- c : mkdir <somefolder>
  title : Making a directory named <somefolder>
- c : git clone https://github.com/<someuser>/<someNodeRepo>.git <somename>
  title : Cloning a node repo in a folder named <somename>
  next :
    - c : cd <somename> && npm install
      title : Installing node dependencies
      next:
        - c : cd <somename> && mkdir <dummyname>
          title : Making a directory named <dummyname>
          next :
            - c : cd <somename> && git remote set-url origin <someurl>
              title : Changing the remote of the node repo
              next :
                - c : touch <file.txt>
                  title : Creating <file.txt>
                - c : cd <somename> && git add . && git commit -m 'initial commit' && git push
                  title : Commit and push
                - c : cd <somename>/<dummyname> && touch <someotherfile>
                  title : Creating a file named <someotherfile>
        - c : cd <somename> && mkdir <anotherdummyname>
          title : Making a directory named <anotherdummyname>
          next:
            - c : cp package.json <somename>/<anotherdummyname>/<myfile>
              title : Copying a package.json into <myfile>
    - c : cd <somename> && touch <somefile>
      title : Making a file named <somefile>
- c : git clone https://github.com/<someuser>/<somePhpRepo>.git <someothername>
  next:
    - c : cd <someothername> && composer install
      next : 
        - c : cd <someothername> && cp .env.example .env
          next : 
            - c : cd <someothername> && php artisan migrate
            - c : cd <someothername> && mkdir <somefolder>
            - c : cd <someothername> && touch <somefile>

The commands will be executed in the following order flow

Usage

- Initialize a script yamlscript make [commands...]

Creates an initial yaml script under the name of script.yaml, or a script with the commands if provided.

Example: yamlscript make or yamlscript make "git clone <myrepourl>" "mkdir folder"

- Load a script yamlscript load <script> [alias]

Validates the script first then loads the script to be used later, it will be loaded under the alias name if provided if not it will be loaded under the script file name.

Example: yamlscript load script.yaml or yamlscript load script.yaml myscript

- Run a script yamlscript run <script>

Run an already loaded script, or a quick run without the script being loaded by typing the path of the script.

Example: yamlscript run myscript or yamlscript run ./script.yaml

executing example

- Display a script yamlscript display <script>

Display an already loaded script.

Example: yamlscript display myscript or yamlscript d myscript

displayscript

- Validate a script yamlscript validate <script>

Validate that a script in a correct Yaml format without loading it.

Example: yamlscript validate script.yaml or yamlscript val script.yaml

- Remove a script yamlscript remove <script>

Remove an already loaded script.

Example: yamlscript remove myscript or yamlscript rm myscript

- List scripts yamlscript ls

List all the loaded scripts.

Example: yamlscript list or yamlscript ls

License

MIT © Mohamed Refaie

Contribute

Contributions are always welcome!