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

pella-bc-scanner

v2.0.9

Published

Barcode Scanning component

Downloads

24

Readme

pella-bc-scanner

A QR / Barcode scanner React component.

Peer Dependencies

v1 -> v2 Migration Guide

v2 seen a complete refactor of the codebase for performance improvements. A couple of changes here:

  1. Component has been renamed from PellaBCScanner to BarCodeScanner.
  2. cameraOption prop has been retired. It now functions as selection mode always, auto has been removed.
// Old
<PellaBCScanner
  isOpen={isOpen}
  setIsOpen={close}
  userClose={close}
  setData={onScan}
  cameraOption='selection'
  />

// New
<BarCodeScanner
  isOpen={isOpen}
  setIsOpen={close}
  userClose={close}
  setData={onScan}
  />

Getting Started

Ensure your project has an .npmrc file with the following:

registry=https://nexus.pella.com/repository/npm-group

Afterwards:

npm install pella-bc-scanner @pella/sash-framework

Usage

The component is fully typed, meaning you can hover over a propname to see intellisense data.

import { BarCodeScanner } from 'pella-bc-scanner';

...

return (
  <BarCodeScanner
    isOpen={isOpen}
    userClose={toggleScanner}
    setIsOpen={toggleScanner}
    setData={setData}
  />
)

Development

To develop within this package:

npm run start

This will concurrently run:

  • a file watching script that rebuilds the dist folder when file changes are made within the lib directory.
  • a local React development server from the harness directory.

The idea is to make changes to the package itself in the lib folder, then test those changes work in a React project from the harness folder.

TypeScript

There are two separate tsconfig.json files in this project. Each one has a different job.

  • tsconfig.json Used by the IDE + Intellisense to typecheck the JavaScript files.
  • tsconfig.build.json Emits TS definition files (.d.ts) to the dist folder from JSDoc types found within JavaScript files.

Updating & Versions

We can use the npm-version process when updating this repo. Running the npm version command will automatically use the preversion, version, and postversion scripts found in the package.json to verify the project, build distribution files, and push to the remote branch while updating the package version based on the version increment type.

  • MAJOR - You've made a major change that is not backwards compatible and could break existing apps.
  • MINOR - You've added new functionality to the project, but did not make any breaking changes.
  • PATCH - You've made a fix to the service, but didn't introduce any new features or breaking changes.
// example bumping minor version
npm version patch -m 'fix some bug'

// example bumping minor version
npm version minor -m 'add npmjs registry support'

// example bumping major version
npm version major -m 'did some big thing that changes functionality'