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

pixijs-cli

v0.2.3

Published

A command-line interface development tool for PIXI.JS

Downloads

34

Readme

Pixi.js CLI

A command line interface for Pixi.js with ES6 support and Pixi.js plugins that facilitate game development.

What is Pixi.js?

Pixi.js is a super fast HTML 5 2D rendering engine that uses webGL with canvas fallback.

Read more: http://www.pixijs.com/

How do I install Pixi.js CLI?

You need to have npm to run:

npm install pixijs-cli -g

  • Please note that this tool is still in beta stages.

How do I use Pixi.js CLI?

pixijs <command (Default: help)>

pixijs create, c

Creates a new pixi.js CLI project

  • --path <path> the path to create the new project
  • --force overwrites exisiting files

Example:

pixijs create MyPixiProject

pixijs serve, s

Starts an http server with LiveReload

  • --port <port> the port to bind to [4200]
  • --host <host> the host to bind to [localhost]
  • --live-reload-port <port> the port to start LiveReload on [35729]

Example:

pixijs serve --port 9999

pixijs addon (search|add|remove|publish) <plugin_name>

Search, adds, removes or publishes a pixi.js plugin

  • search <plugin_name> searches the registry for a plugin
  • add <plugin_name> adds a plugin from the registry to the current project
  • remove <plugin_name> removes an existing plugin from the current project
  • publish <plugin_name> publishes an existing plugin in the project. See documentation on publishing for more details.

Example:

pixijs addon add object-pool

pixijs platform (list | ls | add | remove | rm | update | up)

Adds, remove or list cordova platforms

  • [list | ls] list all platforms for which the project will build
  • add <platform> [<platform> ...] add one (or more) platforms as a build target for the project
  • [remove | rm] <platform> [<platform> ...] removes one (or more) platform build targets from the project
  • [update | up] <platform> updates the Cordova version used for the given platform

Example:

pixijs platform add ios android

pixijs run [<platforms>]

Launches the project on the provided platforms (Note: Will launch on all projects if not platform is provided)

  • --debug enables debug mode when running
  • --release creates a release of the project before running it
  • --device launches the project on connected devices of the selected platforms
  • --emulator launches the project on the selected platform emulator if available
  • --nobuild launches the project without rebuilding the project
  • --list lists all emulators and devices available for the selected platform

Example:

pixijs run ios --device

pixijs compile [<platforms>]

Comile the project on the provided platforms (Note: Will compile on all projects if not platform is provided)

  • --debug enables debug mode when running
  • --release creates a release of the project before running it
  • --device launches the project on connected devices of the selected platforms
  • --emulator launches the project on the selected platform emulator if available
  • --nobuild launches the project without rebuilding the project
  • --list lists all emulators and devices available for the selected platform

Example:

pixijs compile android --release

pixijs plugin (list | ls | add | remove | rm | search | save) <plugin_name>

Adds, remove, list or searches a cordova plugin

  • [list | ls] list all platforms for which the project will build
  • add <plugin_name> [<plugin_name> ...] add one (or more) cordova plugins to the project
  • [remove | rm] <plugin_name> [<plugin_name> ...] removes one (or more) cordova plugins to the project
  • search <plugin_name> searches the cordova plugin repository for the given plugin name keyword
  • save <plugin_name> save the versions/folders/git-urls of currently installed cordova plugins into the project config.xml

Example:

pixijs plugin search maps

pixijs help, --help

Outputs the usage instructions for all commands or the provided command

Example:

pixijs help

pixijs clean

Cleans the project temporary build folders

Example:

pixijs clean

What add-ons are available?

All avaialable add-ons are available here along with their documentation.

How do I create my own add-ons?

Add-ons can be easily created in ES6 module format. Once created you can publish them using the CLI tool pixijs addon publish <path_to_js_file> The add-ons automatically get documented using jsdoc when uploaded to the registry (registration is required via CLI tool) The add-on fields for the registry are:

  • @addon the name of the add-on
  • @description a breif description of the add-on
  • @version the version of the addon. Must be in X.X.X format and greater than the version previously published.
  • @author the name of the person publishing the add-on
  • @email the e-mail of the person publishing the add-on. Must be the same e-mail you registered with.
  • @dependencies (optional) any plugin or vendor libraries that need to be downloaded automatically.

Example

/**
 * @addon Pixi.js CLI add-on
 * @description An add-on for drawable canvas textures
 * @version 1.0.1
 * @author Alejandro Gonzalez Sole
 * @email [email protected]
 *
 * @dependency pixi
 * @dependency https://raw.githubusercontent.com/GoodBoyDigital/pixi.js/master/bin/pixi.dev.js
 **/
import PIXI from 'pixi';

/**
 * The TextureDraw module provides a drawable canvas texture to be used by "PIXI.Sprite" objects.
 *
 * Based on Ezelia's drawing method - http://www.html5gamedevs.com/topic/518-hack-making-all-2d-drawing-functions-available-to-pixi/
 * @module TextureDraw
 * @param  {Function} callback The draw function that contains the "canvas" parameter
 * @return {PIXI.Texture} The pixi texture generated by the drawing.
 * @global
 * @example
 * var myTexture = textureDraw(function (canvas) {
 *   var ctx = canvas.getContext('2d');
 *   ctx.fillStyle = "rgb(200,0,0)";
 *   ctx.fillRect (10, 10, 55, 50);
 * });
 */
function textureDraw(cb) {
  var canvas = document.createElement('canvas');
  if (typeof cb == 'function') cb(canvas);
  return PIXI.Texture.fromCanvas(canvas);
};


export default textureDraw;