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

grunt-lock-extended

v0.2.5

Published

Wraps nodejs lockfile with some additional features

Downloads

7

Readme

grunt-lock-extended

A Grunt-Plugin to handle lockfiles within Grunt, currently just wraps lockSync of https://www.npmjs.org/package/lockfile

Build Status Dependencies Status Dev Dependencies Status

Getting Started

This plugin requires Grunt ~0.4.2

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-lock-extended --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-lock-extended');

Origin

This modul was forked from https://github.com/evangelion1204/grunt-lock. I had some issues with handling lockfile with multi-thread processes.

If you are looking for a simple and easy to use lockfile-wrapper, i recommend grunt-lock.

The "lockfile" task

lockfile: {
    your_target: {
        path: 'yourname.lck',
        //you can add one task to be ignored by the lockfile task. - i use it for an unlock task with email-reporting
        ignored: [
          'taskToIgnore1',
          'taskToIgnore2'
        ],
        //only allowed tasks can create a lockfile - other tasks will fail fatal
        allowed: [
          'taskToAllow1',
          'taskToAllow2'
        ], 
        //if true, just the fails and warnings are logged
        quiet: true|false
    }
}

Options

path [required]

The path where your lockfile will be created

ignored [optional]

a string or an array of tasknames that will be ignored creating a lockfile

allowed [optional]

a string or an array of tasknames. Only there tasks will be able to run, if this option is set

quiet [optional - default=false]

STFU for this module. Just log what is really necessary!

Autostart the lock

To ensure the lockfile-task is invoked everytime you use grunt, you should add the following code right after grunt.initConfig()

grunt.task.run('lockfile');

The "lockfile" format

{
  "user": "currentUser",
  "pid": 12345,
  "tasks": ["theExecutedTask"],
  "created": "<creation time of lockfile in SQL-Format>"
}

Overview

This Module is supposed to be used on multiuser-systems. The generated lockfile will contain information about the invoking task. The Task adds the option "parentPid" with the current pid to the grunt-options. That allows us to start childprocesses, in which the current lockfile will not prevent execution.

To allow a childprocess the execucting user and the given parentPid have to match the ones in lockfile.

In your project's Gruntfile, add a section named lockfile to the data object passed into grunt.initConfig().

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

This plugin was inspired by https://github.com/evangelion1204/grunt-lock