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

packagingjs-cli

v0.1.0

Published

A command line too for PackagingJS and more!

Downloads

4

Readme

PackagingJS Command Line Interface

ES4 style packaging, namespacing, and dependency implementation in JavaScript with added ES6/JSX transpiling from single commands. This is the command line tool for PackagingJS style JS. For more info on writing PackagingJS code see its docs.

Install

$ npm install -g packagingjs-cli

The PackagingJS CLI is intended for smaller projects where creating package.json files and having a bunch of project dependencies is not sensible, but where you still want the basic ability to have a JS module system and ES6/7 and JSX transpiling. Therefore a global install is all you need.

Usage

$ pjs input.js -o output.js

The above will compile input.js and any PackagingJS style imported dependencies, transpile the ES6 and JSX via Babel, and output it into one file named output.js.

The main compiling option is -o <outputfilename> or --output <outputfilename> which determines the destination file. If none is given it will just output the same filename with app. prepended to it. So $ pjs input.js all by itself would output to a file app.input.js.

The 3 main options aside from the output are -p, -b, -r for PackagingJS, Babel, and React JSX respectively. If none of those 3 options are included it just assumes you want all 3 (which is why the examples above work). So to compile with PackagingJS and Babel, but not any JSX you could use $ pjs input.js -o output.js -p -b and likewise to not do any ES6 transpiling at all and just use the module handling: $ pjs input.js -o output.js -p would work.

Note that Babel compiles to stage-0 as effective within the browser version of Babel. The browser version is used due to the fact that the npm version is quite heavy and slow on many systems. This CLI is made to be light and fast for basic usage. If you need more control and the latest version of Babel and want to work with PackagingJS then try the gulp-packagingjs npm module and use with Gulp.

Other options are --autorun <static|instance|none> which determines the PackagingJS autorun method, and --global <globalname> which can be used to determine the global object used by PackagingJS. See the PackagingJS docs for info on both concepts.

Intended Usage

For What:

As has been said already: this is for small stuff. There are tons of ways to use modules and ES6 in projects...they just tend to be heavy and require setup. I wanted a simple way that I could write modular ES6 style (and with PackagingJS ES4 style) code without any project setup and just compile via a single command. I've found tools that do it for being modular...and tools that do it for ES6...but remarkably little that handles both for simple usage. With this you can mock up a quick demo or a mini-project without setting up a big project structure.

Other Instructions:

IMPORTANT! This tool is intended to be used FROM the directory holding the base class, and that base class is intended to be non-namespaced. It may work in other situations, but results will be unpredictable. Use as intended for best results.