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

@paqtcom/recycleclub-calculator

v1.3.2

Published

A Web Component to check what your empty cartridges are worth

Downloads

97

Readme

RecycleClub Calculator

A Web Component to check what your empty cartridges are worth. The RecycleClub Calculator can be implemented and used across any JavaScript framework or no framework at all. We accomplish this by using standardized web platform APIs and Web Components.

Browser Support

We only support the latest modern browsers: https://browserslist.dev/?q=ZGVmYXVsdHMsIG5vdCBpZSAxMQ%3D%3D

npx browserslist "defaults, not ie 11"

Using this component

<html>
  <head>
    <script
      type="module"
      src="https://cdn.jsdelivr.net/npm/@paqtcom/recycleclub-calculator@1/dist/recycleclub-calculator/recycleclub-calculator.esm.js"
    ></script>
  </head>
  <body>
    <recycleclub-calculator></recycleclub-calculator>
  </body>
</html>

We recommend to display it on a background with the color #EDF3F8.

An example of this setup: https://codesandbox.io/s/recycleclub-calculator-usage-vpee94

Charities

If you're a charity using the calculator you need to set the charity-code attribute to the code you will receive from RecycleClub. This way, the compensation for all the cartridges submitted with your calculator will go to you.

<html>
  <head>
    <script
      type="module"
      src="https://cdn.jsdelivr.net/npm/@paqtcom/recycleclub-calculator@1/dist/recycleclub-calculator/recycleclub-calculator.esm.js"
    ></script>
  </head>
  <body>
    <recycleclub-calculator charity-code="enter-your-charity-code-here"></recycleclub-calculator>
  </body>
</html>

i18n

We support the following languages: en, de, fr, and nl. The language will be automatically based on the document language specified in the html tag (<html lang="en">) or otherwise the browser language of the user.

Customization

You can optionally set one of these CSS custom properties ("CSS variables") in a :root block of your css, to change the typography.

:root {
  --recycleclub-calculator-font-family: sans-serif;
  --recycleclub-calculator-font-size: 1.1em;
  --recycleclub-calculator-heading-font-family: serif;
  --recycleclub-calculator-button-font-family: serif;
}

It inherits the font-family and font-size from the parent, so you probably only need to set the --recycleclub-calculator-heading-font-family & --recycleclub-calculator-button-font-family if you want to use a different font for the headings and/or button. For example to use a custom font you've already loaded.

Development

Make sure you are using node v16 (with npm v8). If you use nvm, you can run nvm use.

To start building the components using Stencil, clone this repo to a new directory:

git clone https://github.com/paqtcom/recycleclub-calculator.git recycleclub-calculator
cd recycleclub-calculator

Change the api-endpoint, redirect-hostname & redirect-path attributes in /src/index.html if needed.

and run:

npm install
npm start

To build the component for production, run:

npm run build

To run the unit tests for the components, run:

npm test

To publish a new version on npm, run:

# if not yet logged in
npm login

npm publish

Need help? Check out the docs here.

Automated tests

Run this command to test the component and it's sub components:

npm run test

Or run this command in the root to test the core components and all the framework wrappers.

Release a new version

To create a new npm release, you have to be a member of the paqtcom organization and be logged in to npm in your local terminal (npm login).

Switch to the master branch.

Update the version in the package.json (and package-lock.json) and push this.

Go to the root of the repo in your terminal.

Run these commands:

npm run install
npm run build

If successful, you can then publish this package to npm:

npm publish

Attribution

Ionicons

We used some SVG's from Ionicons.

The MIT License (MIT)

Copyright (c) 2015-present Ionic (http://ionic.io/)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.