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

@wormgraph/helpers

v0.7.49

Published

A template for building shareable libraries that can be used both NodeJS `import` or Browser `<script>` tags.

Downloads

29

Readme

Lootbox Helpers

A template for building shareable libraries that can be used both NodeJS import or Browser <script> tags.

Storybook

Views your modules locally in ESM format import.

$ yarn storybook

Building

$ yarn install
$ yarn build
$ npm publish	# dont use yarn

Usage Locally

Using npm libraries locally is easy using $ yarn link. You will need two repos, the library and the codebase you are working in.

# terminal 1
$ cd guildfx-library-template
$ yarn watch # this will hot-reload
# terminal 2
$ cd guildfx-library-template
$ yarn link # ready to use
$ yarn unlink # when you want to stop
# terminal 3
$ cd my-app
$ yarn link "@guildfx/library-template" # ready to use!
$ yarn unlink "@guildfx/library-template" # unlink when you want to go back to prod version

You will be able to now use the imports locally, without changing any code or imports. Just be aware of local vs prod library imports when developing.

You can also build to UMD/IIFE locally, after $ yarn watch open up ./sandbox.html

<!-- Import Locally from build file -->
<script src="./iife/bundle.js" type="text/javascript"></script>

Usage in server

import { Counter, mockFunction } from '@guildfx/library-template'
const App = () => {
  mockFunction() // prints 'hello'
  return <Counter />
}

Usage in the browser

<!-- index.html -->
<head>
  <!-- we need to import react first -->
  <script src="https://unpkg.com/react@17/umd/react.development.js" crossorigin></script>
</head>
<body>
  <!-- then import our components -->
  <div id="react-target"></div>
  <script src="https://firebasestorage.googleapis.com/v0/b/guildfx-exchange.appspot.com/o/index.js?alt=media&token=ed98e790-1eab-4b7f-acc1-b06065975d69"></script>
  <script>
    // injects a react component into the page at <div id="react-target">
    Lootbox_UI.injectCounter()
  </script>
</body>

@vijayt/counter

This is just a demo component, part of the boilerplate for putting together a project that publishes components to the NPM registry. Features of the boilerplate include: Compilation using Rollup and TypeScript, Unit / Functional testing using Jest and React Testing library, Visual testing using Storybook. There is a tutorial that explains how the project was put together.