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

jspicl-cli

v0.4.0

Published

CLI for simplifying PICO-8 game development in JavaScript

Downloads

25

Readme

jspicl CLI

jspicl CLI is a command line tool that simplifies PICO-8 game development in JavaScript.

Features:

  • Comes with its own set of build pipeline so you don't need one.
  • JavaScript to PICO-8 Lua transpilation through jspicl.
  • Treeshaking which prevents unused code from being included and increasing your token count.
  • Allows a PNG file to be used as a spritesheet, no need to edit your assets in PICO-8 anymore. Use your image editor of choice.
  • Live reloading of PICO-8 cartridge whenever code or spritesheet is updated. See your changes live!

Future goals:

  • Importing audio files to be used as SFX or music.

Installation

npm install jspicl-cli -D

Usage

In order to generate a cartridge you need to supply at least four mandatory options:

jspicl-cli
  --input <entryfile.js>
  --output <outputFile.p8>
  --spritesheetImagePath <pathToSpriteSheetFile.png>
  --cartridgePath <pathToExistingCartridge.p8>

Options

| Name | Type | Description | |-------------------------|-|-| | input | string | Your game's entry point. This file can then import other modules. [required] | | output | string | Where to output the PICO-8 cardridge [required] | | spritesheetImagePath | string | Path to a spritesheet file. Only PNGs are supported. [required] | | cartridgePath | string | Path to an existing cardridge to reuse sound, music and state flags from. Normally you would point this to the generated cartridge so that you can save the assets directly and reuse them. [required]. | | includeBanner | boolean | Include a short comment at the very top of the generated LUA code that contains info about jspicl. Does not affect token count. | | jsOutput | string | Where to output the flattened and transpiled JavaScript code. You may use this with astexplorer to inspect the AST, just make sure to select Esprima as the parser. For debugging purposes. | | luaOutput | string | Where to output the transpiled LUA code. For debugging purposes. | | showStats | boolean | Display statistics about the generated cartridge. Useful for determining how much resources your game is using. | | pipeOutputToConsole | boolean | Output all console.log to terminal that launched PICO-8. For debugging purposes. | | reloadOnSave | boolean | Reload PICO-8 when the cartridge has been updated. | | customPicoPath | string | Custom path to the PICO-8 executable. | | prettify | boolean | Format the generated LUA code. | | watch | | Runs the cartridge in PICO-8 and rebuilds it when the source files change. |

Watch mode

The CLI will listen for changes when the --watch option is passed.

This applies for the spritesheet aswell. Simply save your image and your changes will be reloaded in PICO-8.

NOTE: Reloading the cartridge is currently only supported on MacOS.

Other jspicl related projects