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 🙏

© 2026 – Pkg Stats / Ryan Hefner

picofly

v1.0.1

Published

Tiny state manager, built with ❤

Readme

Picofly

Tiny state manager, built with ❤️

NPM version

After many years of development and testing in real apps, Picofly 1.0 is out! 🎉
And it got itself a site picofly.dev

⚡ Fast: lazy proxies, hand-tuned hot paths, renders only what changed
🤏 Tiny: 683 B core, 1.27 kB with React support
🥧 Simple: ~160 lines of code, ~140 more for React
🍳 Handy: you think about what to do, not how
⚛️ React & React Native: hook or selectors, whichever fits
🔋 Charged: Map, Set and TypeScript out of the box
🪟 Transparent: your objects stay your objects

Supported

React >= 19
React Native >= 0.78
Preact >= 11 (beta now, why not 10)

Install

npm i picofly

How to use

create(state) wraps your state and gives back the store. Read what you need in a component and write from anywhere outside render. The component renders only when a property it actually read changes.

Objects, arrays, Map and Set are proxied. Date, Error, RegExp and the like stay as they are.

React example

Picofly works with a hook or with selectors. The trade-offs are in Hook vs selectors.

store.js

import {create, markRaw} from 'picofly'

// a plain object works too
class State {
	api = null
	videos = new Map()
}

export let createStore = () => {
	let state = new State()
	let app = create(state)

	// service objects can live on the store too
	// markRaw keeps them as they are, never proxied
	app.api = markRaw(app, createApi())

	return app
}

app.js

import {Picofly} from 'picofly/react'
import {createStore} from './store'
import VideoList from './video-list'

let app = createStore()

let App = () => {
	return (
		<Picofly value={app}>
			<VideoList/>
		</Picofly>
	)
}

video-list.js

This one uses the hook.

import {useStore} from 'picofly/react'
import Video from './video'

// VideoList reads the ids only, so it renders
// only when a video is added or removed
export default function VideoList() {
	let app = useStore()

	let ids = Array.from(app.videos.keys())
	let videos = ids.map(id => <Video id={id} key={id}/>)

	let addVideo = () => {
		app.videos.set(Math.random(), {name: 'Cool video', watched: false})
	}

	return (
		<div>
			{videos}
			<button onClick={addVideo}>ADD</button>
		</div>
	)
}

video.js

This one uses selectors.

A selector is a plain function that picks data out of the store or attaches an action. Selectors run in the render context, so hooks work inside them.

Keep them small and generic and they will be reused between components; a complex selection is a combination of simple ones.

import {select} from 'picofly/react'

// takes the video out of the store by the id in props
let videoById = (app, props) => ({
	video: app.videos.get(props.id),
})

// actions usually come from the business logic layer
let watchVideo = async (app, id) => {
	await app.api.watchVideo(id)

	let video = app.videos.get(id)
	video.watched = true
}

// select() merges what the selectors return
// and passes it to the component as props
export default select(
	videoById,
	(app, props) => ({
		onWatched: () => watchVideo(app, props.id),
	}),
)(Video)

// Video reads name and watched only, so it renders
// when one of them changes
function Video({
	video = {},
	onWatched,
}) {
	return (
		<div>
			<span>{video.name}</span>
			<span>{video.watched ? '✅' : '🚫'}</span>
			<button onClick={onWatched}>WATCH</button>
		</div>
	)
}

Docs