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 🙏

© 2026 – Pkg Stats / Ryan Hefner

fitfab-ui

v3.1.1

Published

fitfab UI elements

Readme

Fitfab-UI Component (Rollup, TypeScript, Babel, React styled-components)

With this release, I target ES6 JavaScript. ES6 is much closer to TypeScript and produces less code, which means faster loading times.

  • This Library is meant to be used in modern browsers -- It doesn't support IE11.
  • Other decisions: read more here

peerDependencies:

  • react@^16.8.4
  • react-dom@^16.8.4
  • styled-components@^4.1.3

install

yarn add fitfab-ui

usage

import { prettyDate } from 'fitfab-ui'
const pretty = prettyDate('8/2/2019')
// pretty should be: 'August 2 2019'

See the Storybook setup

Using local copy of fitfab-ui

NPM LINK

  • from the root of 'fitfab-ui' run: npm link
  • from the root of your app run: npm link fitfab-ui

Then start using as normal:

import { Button } from 'fitfab-ui'


Script CMD explained.

NPM CMD: read about npm scripts

"prepublishOnly": "npm test && npm run lint"

  • This run BEFORE the package is prepared and packed, ONLY on npm publish.

  • A good place to verify that linting rules and tests are passing.

Rollup TypeScript & Babel setup

Jest & Enzyme setup

NOTE: make sure that jsx is set to react { "jsx": "react" } within the tsconfig.json file.

Jest & React testing library setup

  • create the file rtl.setup.ts
// See https://github.com/kentcdodds/react-testing-library#global-config
import '@testing-library/react/cleanup-after-each'
import 'jest-dom/extend-expect'
  • Then add it to jest.config.js -- on this project I have a /config folder where the rtl.setup.ts lives.
    /***
     * Setup React-testing-library
     */
    setupFilesAfterEnv: ['<rootDir>/config/rtl.setup.ts'],

Three-Shaking Gotcha

if you were to use export default , the bundle would not be three shaken.

// src/utils.js
export default {
    alert: msg => {
        console.log(msg)
    },
    sum: (x, y) => x + y,
}

// src/main.js
import utils from './utils'

const total = utils.sum(7, 4)
console.log(`This is the total: ${total}`)

The code will include alert eventhough it was NOT use in the main.js file.

Migrate from TSLint to ESLint

reference:

  • https://code.visualstudio.com/api/advanced-topics/tslint-eslint-migration
  • https://www.robertcooper.me/using-eslint-and-prettier-in-a-typescript-project
  • https://medium.com/@okonetchnikov/make-linting-great-again-f3890e1ad6b8#.8qepn2b5l

Husky & lint-staged update 2021

  • npx husky-init && npm install

    Note: Husky will create a prepare script command within package.json

  • npx mrm@2 lint-staged

    This command will install and configure husky and lint-staged depending on the code quality tools from your project's package.json dependencies

creating a new husky hooks

  • npx husky add .husky/pre-push 'npm test'

    Note: add the pre-push hook to only run the tests when pushing

  • npx husky add .husky/commit-msg 'message'

    Note: This is to enforce Conventional Commits specification

Commitlint setup

Read the Local Setup Guide for Commitlint

adding fitgma tokens