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

wooz

v1.0.4

Published

A CLI application that allows you to automate your tasks!

Downloads

19

Readme

Wooz

A CLI application that allows you to automate your usual tasks!

Table of Contents

  1. Documentation

    1. Requirements
    2. Installation
    3. How to use it?
    4. How it works?
    5. wooz.config.json
    6. wooz.tasks.json
    7. Commands
    8. Questions
  2. Support

  3. License

Documentation

Requirements

  1. First, make sure you have the latest version of Node.js installed.
  2. Wooz relies on git and quasar to run some tasks that depend on them, so make sure these tools are installed if you are planning to use these kinds of tasks, otherwise just ignore them!
  3. Tested only with git repositories that uses HTTP(S) URLs for their remote(not tested with SSH URLs).

Installation

Run:

npm install wooz -g

How to use it?

Go to an empty folder that you have permissions to write into it and run:

wooz run

How it works

Wooz needs two files in the directory that you run it within it, these files are wooz.config.json and wooz.tasks.json, so when you run it for the first time it will ask you to create these configurations and tasks files then it will be able to continue.

Simply you can consider Wooz as a webhooks interface on your server it will listen for a POST requests with the action that you specify and will run the tasks that you want.

When you run Wooz it will listen on the port that you specified to it, for example say you have a bitbucket repository and you want whenever you make a commit the code gets updated and build and deployed on your server, you can create a webhook in the repository settings on bitbucket with the following URL for example https://webhooks.yourdomain.com/the-action

Then Wooz will do the rest!

Of course, Wooz will work on localhost like for example http://localhost:3131 and if you want it to be accessible from outside of your server you must create some kind of proxy, you can read this article (please note that the example in this article uses an old version of Node.js) that talks about this.

Note: Wooz only listens for the POST requests.

wooz.config.json

Wooz uses this file to save its configurations, here is a sample of this file:

{
	"port": 3131
}

You can create this file manually by using any text editor or you can let Wooz generates it for you, here is what every configuration means(currently Wooz has just one configuration option!):

  • port: (Number) The port that Wooz will use so you can access it using this port like for example: http://localhost:3131

wooz.tasks.json

Wooz uses this file to save the tasks, here is a sample of this file:

[
	{
		"action": "RunQuasarSSR",
		"type": "QuasarSSR",
		"path": "/home/mohammed/MyTmp/11/quasar",
		"copyDistTo": "/home/mohammed/MyTmp/11/prod/ssr-dist-copy"
	},
	{
		"action": "RunQuasarPwa",
		"type": "QuasarPwa",
		"path": "/home/mohammed/MyTmp/11/quasar",
		"copyDistTo": "/home/mohammed/MyTmp/11/prod/pwa-dist-copy"
	},
	{
		"action": "RunHTML",
		"type": "HTML",
		"path": "/home/mohammed/MyTmp/11/html",
		"copyDistTo": "/home/mohammed/MyTmp/11/prod/html-copy",
		"exclude": ".git,node_modules"
	},
	{
		"action": "RunRepository",
		"type": "repository",
		"path": "/home/mohammed/MyTmp/11/repository"
	},
	{
		"action": "RunWebpack",
		"type": "webpack",
		"path": "/home/mohammed/MyTmp/11/webpack",
		"buildFolder": "build",
		"copyDistTo": "/home/mohammed/MyTmp/11/prod/dist-copy"
	},
	{
		"action": "RunNextJS",
		"type": "NextJS",
		"path": "/home/mohammed/MyTmp/11/NextJS"
	},
	{
		"action": "SomeTasks",
		"type": "custom",
		"subTasks": [
			{
				"type": "command",
				"command": "rm -rf deleteme",
				"path": "/home/mohammed/MyTmp/11/custom"
			},
			{
				"type": "command",
				"command": "git clone https://github.com/MohammedAl-Mahdawi/nosbackup.git",
				"path": "/home/mohammed/MyTmp/11/custom"
			}
		]
	}
]

You can create this file manually using any text editor or you can let Wooz generate it for you.

The tasks are self-explained, you can have as many tasks as you want, here is an explanation for these tasks:

  • QuasarSSR: Wooz will do the following using this type of task:

    1. Run git to update the repository at the path that you specified and it will force the pull request so it will ERASE any local changes.
    2. Run npm install if Wooz found any changes in the package.json file.
    3. Run Quasar SSR PWA build.
    4. Copy ssr-mat to the path that you specified in copyDistTo.
  • QuasarPwa: Wooz will do the following using this type of task:

    1. Run git to update the repository at the path that you specified and it will force the pull request so it will ERASE any local changes.
    2. Run npm install if Wooz found any changes in the package.json file.
    3. Run Quasar PWA build.
    4. Copy pwa-mat to the path that you specified in copyDistTo.
  • webpack: Wooz will do the following using this type of task:

    1. Run git to update the repository at the path that you specified and it will force the pull request so it will ERASE any local changes.
    2. Run npm install if Wooz found any changes in the package.json file.
    3. Run npm run build.
    4. Copy the buildFolder(if no buildFolder specified then the buildFolder will be dist) to the path that you specified in copyDistTo.
  • NextJS: Wooz will do the following using this type of task:

    1. Run git to update the repository at the path that you specified and it will force the pull request so it will ERASE any local changes.
    2. Run npm install if Wooz found any changes in the package.json file.
    3. Run npm run build.
  • HTML: Wooz will do the following using this type of task:

    1. Run git to update the repository at the path that you specified and it will force the pull request so it will ERASE any local changes.
    2. Run npm install if it found package.json file and found any changes in the package.json file.
    3. Copy the folder content to the path that you specified in copyDistTo and exclude the folders that you specified in the exclude option(comma separated folder names).
  • repository: Wooz will do the following using this type of task:

    1. Run git to update the repository at the path that you specified and it will force the pull request so it will ERASE any local changes.
    2. Run npm install if Wooz found any changes in the package.json file.
  • custom: This is where you can construct your tasks, the custom task allows you to create sub-tasks, currently it only allows you to run command(s) sequentially, the command will run in the same order that they appear in it in the wooz.tasks.json, so in the above example the command rm -rf deleteme will run and finished then the command git clone https://github.com/MohammedAl-Mahdawi/nosbackup.git run.

Commands

  Usage: wooz [options] [command]

  CLI app to automate your usual tasks!

  Options:

    -V, --version     output the version number
    -h, --help        output usage information

  Commands:

    configurations|c  Reset the configurations
    tasks|t           Reset tasks
    run|r             Run, using the existing configurations and tasks, or create them if they do not exist.

For example, you can run:

wooz r

or

wooz run

To run Wooz and create the configurations and tasks files if they do not exist.

To create/recreate the configurations file run:

wooz c

or

wooz configurations

To create/recreate the tasks file run:

wooz t

or

wooz tasks

To get help run:

wooz -h

or

wooz --help

Questions

How to daemonized, monitor and keep Wooz alive forever.

There are a lot of tools, however, you can use PM2 to achieve that.

  1. First install PM2 by running npm install pm2 -g

  2. Create ecosystem.config.js file in the folder that you specified for Wooz(must have write permissions) with the following content:

    module.exports = {
    apps: [{
        name: 'Wooz',
        script: 'wooz',
        cwd: '/path/to/this/folder/',
        args: 'r'
    }]
    };

    Please replace /path/to/this/folder/ with your folder path.

  3. Run pm2 start ecosystem.config.js in the same folder.

  4. To stop and delete the process(undo the above step) you can run pm2 delete Wooz

Support

This app built to run on Linux PCs/servers, so it may or may not work on your PC, please only report an issue if you run a Linux based operating system, unfortunately, I will not be able to test and reproduce the issue in order to fix it on the other platforms.

You are welcome to contribute code and provide pull requests for Wooz, also please feel free to suggest or request any features or enhancements.

License

Copyright (c) 2018 Mohammed Al-Mahdawi Licensed under the MIT license.