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

pico-build

v0.0.2

Published

A simple build tool for working with PICO-8 lua files

Downloads

7

Readme

pico-build

An all-purpose command-line tool for building PICO-8 games. Write your game as multiple lua files, and have them compiled into tabs within your .p8 cart.

In watch mode, you can launch your cart in PICO-8 from the command line. Calls to printh() in your game will be logged in the terminal. PICO-8 will automatically reload when you change a file (currently MacOS only).

demo

Quickstart

$ npm i -g pico-build
$ mkdir my-game && cd my-game
$ pico-build init
$ pico-build build --watch

Installation

To install pico-build, you will need either npm or yarn.

$ npm install --global pico-build

or

$ yarn global add pico-build

Usage

build

$ pico-build build --src ./src --cart ./my-cart.p8 --watch

Builds the lua files in ./src into a cart named my-cart.p8.

Options

  • --src / -s - The folder containing your lua files. It will concatenate these files in order alphabetically. I recommend naming them '0.foo.lua', '1.bar.lua', '2.baz.lua', etc. The files will be separated into tabs within the PICO-8 editor.
  • --cart / -c - The output cart file. If the file does not exist, it will create one. If it does exist, it will replace the code in the cart and leave the rest of it untouched.
  • --watch / -w - Enables watch mode. Will automatically rebuild the cart when any of the lua files change. From watch mode, you can open PICO-8, and (on MacOS) the game will automatically reload on rebuilds.
  • --executable / -e - The path to your pico-8 executable file. pico-build will try finding this on its own, but you can specify it if it is not in the standard place for your OS.

extract

$ pico-build extract --src ./src --cart ./my-cart.p8

Extracts the code from my-cart.p8 into lua files in ./src. If the code in the cart contains tabs, each tab will be extracted into its own file.

init

$ pico-build init

Creates a starter PICO-8 project in the current folder. pico-build will prompt you for the game's name, version, description, and author name. It will create the following files:

  • pico.toml - The config file for the project. The pico.toml format is described below.
  • [game-name].p8 - The PICO-8 cart for your game.
  • src/0.init.lua - The entry point for your lua code.

Config File

pico-build can read from a configuration file so you don't have to specify every option in the command line. It will search for either pico.toml (using toml) or pico.json. The following properties are supported:

  • src_dir [string] - The folder containing lua files
  • cart [string] - The path to your .p8 file
  • watch [boolean] - Enables watch mode
  • open_pico [boolean] - Opens your cart in PICO-8 on build
  • executable [string] - The path to your pico-8 executable
  • name [string] - The name of your game. Currently unused.
  • description [string] - The subtitle of your game. Currently unused.
  • version [string] - The version of your game (ex: '1.0.0')
  • author [string] - The name of the game's author(s)

Here is an simple example config file:

# pico.toml
src_dir = 'src'
cart = 'my_game.p8'
watch = false
open_pico = true