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

head-master

v1.0.3

Published

Manage your modules

Downloads

5

Readme

head-master

HeadMaster

What is it?

Just a Bundler

Usage in nodejs script

Instantiation

npm install head-master

Native

var HeadMaster = require('head-master');

// {HeadMaster instance} HeadMaster.pack({string}content \[, {string}namespace\] \[, {object}options\]);
HeadMaster.pack(content, namespace, options)

// And then, you may use many output methods
.toString() === {string} to string
.toBuffer() === {buffer} to buffer instance
.toFile() === {*} to string and write as a file
.toStream() === {file} to file instance

TODO: The first parameter will support multi-state. content, src, path(file/dir)

options

  • base {string} The input path, must be set. default: null
  • contents {string} inputs contents. default: null
  • package {string} inputs package names(entrance name when packing). It will be assigned a random string when no setting, if the "contents" has been set, this invalid. default: null
  • namespace {string} Global namespace(output path). If not otherwise specified, will inherit "package". default: null
  • table {string} Indent character. default: '\t'.
  • mainfile {string} mainfile path. TODO
  • uglify {boolean} Whether uglify compile, default: false. TODO will support uglify configuration inputs.
  • type {integer} Output header type. values: 0~7, default: 0
    • 0 No header
    • 1 Global
    • 2 Common js
    • 4 AMD
  • variablify {boolean} Reference assembling converted to variable declaration, When enabled, better efficiency but fat. default: false.
  • camelCase {boolean} This will be effective when "variablify" enabled, Use underScoreCase OR camelCase naming convention to convert. It provides solutions for different file naming, if you use the name in two ways, God bless you ╮(╯▽╰)╭. default: false.

Gulp OR stream pipes

var HeadMaster = require('head-master');

gulp.src(['./js/**/*.js'])
    .pipe(HeadMaster.map(options))
    .pipe(gulp.dest('./dist'));

options

  • bundle {string} special in stream mode. values: 'tree', 'map', 'relax'

Others will inherit the default parameters, base is no need to set

Usage in command line

Global installation

sudo npm install -g head-master

Command calls

hm source output_dir options

Options

hm -h

Advanced usage

var HeadMaster = require('head-master');
new HeadMaster(options).pack();
new HeadMaster(options) // Initialization
    .crawl()            // Analysis, dependency
    .organize()         // Packaging
    .header()           // Add header
    .uglify()           // Compile compression
    .to[Any]()          // Output AND Returns

// .paramParse() can be used every where, adjust the rear of the parameters from the current