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 🙏

© 2025 – Pkg Stats / Ryan Hefner

phaxelf-lib

v0.5.0

Published

Go phax your elf

Readme

phaxelf-lib

The Pha[ser] [Rising Pi]x[el] Elf [Games Works] library.

Go phax your elf.

Online documentation at http://risingpixel.github.io/phaxelf-lib

What is this?

A random set of utility classes to build better Phaser games.

Installation

To install this library in your project:

npm install --save phaxelf-lib

Or with yarn:

yarn add phaxelf-lib

Example Usage

Quickstart

After installing the library, you can just require what you need from the package:

import { Drag } from 'phaxelf-lib';

mySprite = game.add.sprite(0, 0, 'somesprite.png');
Drag.enable(mySprite);

Extensions

Phaxelf provides a set of extensions for the default phaser methods, to handle scaling, coordinates and tweening easier.

To use them, you have to initialize it manually in your game startup.

import { Extensions } from 'phaxelf-lib';

// ... your main file
Extensions.init(LU);
/// ... other stuff

Then, you can just find them ready as methods.

Moving a sprite in the hierarchy in the same screen position of another one

mySpriteInAScaledGroup = game.add.sprite(0, 0, 'sprite1.png');
mySpriteInAnotherMessyScaledGroup = game.add.sprite(0, 0, 'sprite1.png');

mySpriteInAScaledGroup.$$moveTo(mySpriteInAnotherMessyScaledGroup);

Check if a point is contained in a sprite, no physics

sprite.$$contains(new Phaser.Point(100, 100)); // => true/false

Shortcut for tweens

let tween = sprite.$$tween({ x: 100, y: 100}, 1000, { repeat: 10, yoyo: true, autostart: true });

Tint tweening

let tween = sprite.$$tintTween(0xff0000, 1000);

Scale tweening

let tween = sprite.$$scaleTween({ x: '+0.5', y: '+0.5' }, 1000, { yoyo: true });

Complete reference here.

Library Local Development

To test this library locally, first of all install the npm dependencies. Remember to run it every time you update them:

npm install

Build the library by using gulp:

npm run start

It will automatically rebuild the sources when you change the files.

Then, to add it in your project, specifying the current folder where you've downloaded the library sources.

npm install --save path/to/phaxelf-lib # Replace this with your library path

You may need to re-run this two last commands during the development cycle to update the sources in your project.

Pro tip

You can concatenate this commands to make the development cycle easier, like:

npm install --save path/to/phaxelf-lib && npm run start:dev

On windows:

npm install --save path\to\phaxelf-lib; npm run start:dev

Docs generation and publishing

Docs are auto-generated by the gulp task.

To update the online documentation, just run:

npm run docs:publish

Library publishing

  • Make sure you're logged in in npm, using npm whoami. If not, just register using npm adduser.
  • Update the version number in the package.json file, using semantic versioning. To achieve this, use npm version patch, replacing patch with one of patch, minor, major.
  • Run npm publish to publish the new release