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

cdva-hooks

v0.0.17

Published

Automates the creation of the Cordova Hooks folders

Downloads

4

Readme

Cordova Hooks (cdva-hooks)

Automates the creation of a Apache Cordova project's hooks folders. With hooks folders, any executable code placed in the folder is executed at specific points in the Cordova project lifecycle. Developers create separate folders for each event they want to augment with their custom code, and the Cordova CLI automatically takes care of the process. The Cordova hooks folders are placed in a Cordova project folder called hooks. For details on the Cordova hooks approach, see http://cordova.apache.org/docs/en/dev/guide/appdev/hooks/index.html.

Note: Unfortunately, the hooks folder approach was deprecated http://cordova.apache.org/docs/en/dev/guide/appdev/hooks/index.html#via-hooks-directory-deprecated, but apparently it still works until they remove it completely.

Installation

To install the module, open a terminal window and execute the following command:

npm install -g cdva-hooks 

Usage

Execute the module by executing the cdva-hooks command at a command-line. The module expects to be executed from a Cordova project folder (although it doesn't check to see if it's in a Cordova project folder) and accepts the following command-line switches:

  • -all: Create all hooks folders

  • -l: List all hooks options

Examples:

To display this modules's help file, issue the cdva-hooks command without any parameters:

cdva-hooks

To create all of the Cordova hooks folders, use the following:

cdva-hooks -all

To list the available Cordova hooks options use the following:

cdva-hooks -l

To create folders for specific hooks, specify one or more hooks on the command-line.

cdva-hooks hook_list

So, for example, to create the platform_add and prepare hooks folders, use the following:

cdva-hooks platform_add prepare

Since both of those have before and after options, the command will create the following folders:

before_platform_add
after_platform_add
before_prepare
after_prepare

Revision History

October 8, 2016 - Changed the code that processes command-line arguments. Updated the hooks folder list, removing some and adding others.

July 26, 2015 - Fixed serious issues with the readme file - it listed cdvahook instead of cdva-hooks everywhere. Noticed as part of this that the node command used to invoke this didn't align with the module name, so I (sorry) changed it. Originally, the command was invoked using cdvahook, but because the module name is different, I changed it to match the module name.


By John M. Wargo - If you find this code useful, and feel like thanking me for providing it, please consider making a purchase from my Amazon Wish List. You can find information on many different topics on my personal blog. Learn about all of my publications at John Wargo Books.