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

joydb

v1.1.3

Published

JOY is a JavaScript framework for building user interfaces and progressive applications.

Downloads

20

Readme

What is JOY?

JOY is a JavaScript UI framework that includes the fully decentralized Gun database and SEA user authentication libraries.

JOY allows you to build fully realized, progressive applications with offline first functionality and an almost magical noBackend experience, all with client-side Javascript.

Note: Currently, JOY is meant for Netlify users who want to add dynamic data to their static sites. See #JAMstack for more information.

Getting Started

You can use JOY along side React, Vue, vanilla JS, or others. It can be adopted in full, or in part, depending upon your organization's needs.

First, create an index.html file and add JOY to it:

<script src="https://cdn.jsdelivr.net/npm/joydb/joy.min.js"></script>

<div name="app">
  <h1>{{ message }}</h1>
  <input name="message" placeholder="type a message here"/>
</div>

JOY will bind the template, such as {{ message }}, to data on app.message based on the HTML name attribute hierarchy.

There you have it, your first joyDB app! Everything is reactive and persistent across reload and different devices. Try typing into the input field, and your app will update with only the differences re-rendered.

Namespace

By default, top level namespaces are global and public, meaning anyone can edit data on them.

If you want your app to only be editable by you, you need to create an authenticated namespace.

On a JOY enabled app, open up the browser console (right-click on page -> inspect -> console) and type:

Note: There is NO password reset ability, so back it up somewhere safe.

JOY.auth('username', 'passphrase', true);

(replace username and passphrase with something unique to you!)

Or to login to your namespace: (logins are buggy, you may have to try a several times for it to work - I had to repeat this command 5 times over several seconds before it would work, it kept on incorrectly saying "Wrong user or password"!)

JOY.auth('username', 'passphrase');

Note: NEVER add these lines in your source code, or it will expose your credentials!

It should then print a message saying something like:

Your namespace is publicly available at ~RUgiQmS-L1uzSfy2xyTBF_C8pILPc4Dpky6UVQ5rrqo.JArEwhz1K-IWzt9Lf0LEb1-kfw82sfv_SY2eFbZUeD0

Copy and paste everything starting with and including the ~ and paste it into the top-level <div name="app"> name attribute, replacing app. It will look something like this:

<div name="~RUgiQmS-L1uzSfy2xyTBF_C8pILPc4Dpky6UVQ5rrqo.JArEwhz1K-IWzt9Lf0LEb1-kfw82sfv_SY2eFbZUeD0">

Now your app, and all data underneath it, can only be edited by you when you are logged in.

Schema

You will be able to declare your app's data types inline, with your HTML template, and it will automatically enforce and validate input.

This feature is not yet available.

Loops

This feature is in alpha.

Conditionals

This feature is not yet available.

Peers

Getting a warning?

Warning: No peer provided, defaulting to DEMO peer. Do not run in production, or your data will be regularly wiped, reset, or deleted.

You can run your own free peer with these 1-click deploy instructions.

Then add your peer(s) to JOY like so:

<head>
  <link type="peer" href="https://gunjs.herokuapp.com/gun">
  <link type="peer" href="http://localhost:8765/gun">
</head>

Why in the head as a link tag? So that way JOY can start syncing with those peers before the DOM is even loaded, resulting in a faster render time!

Netlify

You'll soon be able to create your JOY app with Netfliy's addons command. Check back soon for the launch!

Community

Need help getting started?

Want to contribute?

Have questions?

Want to vote on feature requests?

Then check out our community chat!

License

MIT