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-packitjs

v1.0.9

Published

grunt-packitjs makes use of packer by Dean Edwards to pack JavaScript files efficiently.

Downloads

14

Readme

grunt-packitjs

Build Status npm

This is a grunt plugin to make use of /packer/ by Dean Edwards to pack javaScript files efficiently.

Installation

If you use npm:

npm install grunt-packitjs

If you don't use npm, clone this repository or download the latest version using the GitHub repository Downloads link.

Usage

Basic packing and concatenating files with default options

	packit: {
		options: {
			attribution: true,
			base62: true,
			shrink: false
		},

		target: { //target
			options: {  //default options
				pack: true,
				banners: true,
				action: 'write',
				dest: './out/main.js'
			},
			files: [
				{
					cwd: './in',
					src: '*.js',
					expand: true,
					flatten: true
				}
			]
		}
	}

Options

attribution

Type: Boolean Default: true

Turn on or off attribution at the start of each dest file (as defined under target specific options below).

base62

Type: Boolean Default: true

You can specify if base 62 encoding is to be applied or not with a boolean value

shrink

Type: Boolean Default: false

You can specify if variable name shrinking is to be applied or not with a boolean value

Target-specific options

dest

Type: String Default: ./test.js

Single output file with full path relative to project directory. If not specified, default outputfile will be test.js at the root of project directory. Currently, packitjs is supporting output into a single file per target.

pack

Type: Boolean Default: false

Disabling this option simply combines the source files into dest, without any packing. If pack is enabled, then source files are packed individually based on base62 and shrink conditions, and combined into dest

banners

Type: Boolean Default: true

Banners are simple file names added as comments before the file content. If set to true, every file will have a banner before it, else there will simply be file content.

action

Type: String Default: write

Three types of actions are supported: 'write', 'append', and 'prepend'.

  • Write - creates a new file at dest or overwrite existing file dest and file will contain only the output from the specific target.
  • Append - reads an existing file dest and adds the output from the specific target to the end of file. Existing contents are retained.
  • Prepend - reads an existing file dest and adds the output from the specific target to the start of file. Existing contents are retained.