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

@devvit/play

v0.0.43

Published

A little playground for building apps on Reddit.

Downloads

1,466

Readme

:play :play

A little playground for building apps on Reddit.

Installation

npm install --save-prefix= @devvit/play

See the changelog for release notes.

Usage

Import play in your JavaScript bundle to define the play-pen element:

import '@devvit/play/pen'

Add a pen to your HTML markup:

<play-pen>
  <script type="application/devvit">
    import {Devvit} from '@devvit/public-api'

    Devvit.addCustomPostType({
      name: 'Say Hello',
      render: () => <text>Hello!</text>
    })

    export default Devvit
  </script>
</play-pen>

Artifacts

Published releases include:

  • play-.*.html: portable playground (Firefox only since v0.0.32).
  • play-pen.js: play-pen element.
  • play.js: library utilities.

Development

npm install
npm start

Visit http://localhost:1234 in your web browser. Run npm test to execute tests.

See supplemental development notes.

NPM scripts

  • install: install play dependencies.
  • start: run development server.
  • test: build play and execute all tests. Anything that can be validated automatically before publishing runs through this command.
  • run test:unit: run the unit tests. Pass --update to update all test snapshots.
  • run test:ui: run the user interface integration tests. Pass --manual to inspect browser and / or a filename to filter.
  • run format: apply lint fixes automatically where available.
  • run build: compile source inputs to artifacts under dist/.

💡 Add -- to pass arguments to the script command. For example, npm run test:unit -- --update to update snapshots.

Project Structure

  • docs/: supplemental play documentation.
  • src/: source inputs.
  • tools/: development tools for building :play.

Contribution Guidelines and Design Principles

  • Make it fun. play must be fun to use and fun to develop. Speed and quality are play's top two features.
  • Avoid dependencies. Dependencies are high-cost integrations. Simply don't add them.
  • Avoid code. Lines of code are costly. We probably can't afford your code if you write a lot of it.
  • Open-source for everyone. This repo was started with the intention to be open-sourced as soon as possible.
    • All dependencies must be available publicly. Avoid closed-source Reddit dependencies.
    • Avoid Reddit-specific branding.
  • Code should be written to be read. We value good context. This often means including short inline or accompanying docs.
  • Keep the interface and outputs plain and simple. play is only a tool. The user's focus is their work.
  • Every commit should be an overall improvement. If every commit is an improvement, the code only gets better.
  • Smaller patches get better reviews.

License (BSD-3-Clause)