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

@fairfair/f-table

v1.1.6

Published

## Default values

Downloads

31

Readme

FTable Component

Default values

  • perPage : 20
  • sortBy : first column
  • orderBy : DESC

Development use

Clone .env.example as .env and fill it with accurate variables

Required props

  • name: name of the table (used for localstorage)
  • apiUrl: api endpoint
  • apiInstance: axios instance
  • columns: array of columns to display in the table

example of column object:

{
    name: 'Statut', // required: column title
    field: 'order_status', // required: database field name (accept callback)
    searchField: true,
    type: 'badge',
    badgeOptions: [
        {
          name: 'A proposer',
          field: 'order_status',
          value: 0,
          color: 'red',
          colors: { // NEW OPTION (no breaking change) => Custom background & text colors in order to add full classnames for tailwindcss purge
              background: 'bg-red-100',
              text: 'text-red-800',
          },
          brotherFilters: [ // Optionnal : apply other fields condition on the same filter
            { 
              field: 'order_end_reason', // example
              value: 'null' // example
            }
          ],
        },
        { ... },
    ], 
}

Note about type options:

  • text (default) : use 'contains' operator in queries
  • id : use 'eq' operator in queries
  • date & age : format value as human readable data
  • duration-day : Convert seconds integer into days integer
  • badge : display a label according to badgeOptions if exist, show field value else

Optional props: options object, with following keys

  • defaultParams: to override default values, for every request (see api doc for syntax)

    • perPage: number of lines displayed per page
    • orderBy: only value accepted is 'ASC' (default 'DESC')
    • sortBy: field string to sort data
    • filters: object of filters
  • params: merged to defaultParams, used until reset

    • filters
  • filters: array of clickable filters (see labelled item above for syntax)

  • onRowClicked: behavior when a row is clicked

    • field: field used as param for redirection (default is first column)
    • page: target component name ; if undefined, an event 'on-row-clicked' is emitted with field value

/!\ DEPRECATED since v1.0.0

  • perPage: now defaultParams.perPage
  • orderBy: now defaultParams.orderBy
  • sortBy: now defaultParams.sortBy
  • permanentFilters: now defaultParams.filters
  • defaultFilters: now params.filters
  • filterButtons: now filters