Content-Length: 318667 | pFad | http://github.com/By2225/StreetCred_categories

8C GitHub - By2225/StreetCred_categories: JS utility wrapper for places category taxonomy
Skip to content

By2225/StreetCred_categories

Repository files navigation

Categories Build Status

This is a JavaScript utility module that represents a category taxonomy (nested list) for places people care about in the world, aka Points of Interest (POIs). Categories represent the place type, for example a Starbucks is a coffee_shop.

Usage

Install via npm or yarn

yarn add @streetcredlabs/categories
or
npm i --save @streetcredlabs/categories

Import/require in the JavaScript client code

// using CommonJS
const { findById } = require('@streetcredlabs/categories');

// using ES6
import { findById } from '@streetcredlabs/categories';

API

findById

This function allows the client to look up the category object by its id. Categories may be nested.

import { findById } from '@streetcredlabs/categories';
const category = findById(1);
{
  "id": 1,
  "name": "Arts & Entertainment",
  "icon": "theatre",
  "categories": [ <category> ]
}

dump

Returns the entire categories array.

import { dump } from '@streetcredlabs/categories';
const categories = dump();
[
  {
    "id": 1,
    "name": "Arts & Entertainment",
    "icon": "theatre",
    "categories": [...]
  },
  ...
]

Contributing to this project

Pull requests are warmly welcomed.

Clone the repo

git clone git@github.com:streetcredlabs/categories.git && cd categories

Install dependencies

yarn
or
npm i

Run tests and watch for changes:

yarn test-watch
or
npm run test-watch

Run tests once:

yarn test
or
npm run test

Run build and watch for changes:

yarn start
or
npm run start

Run build once:

yarn build
or
npm run build

Project Technical Decisions

Plugins/Modules Used Within Package

Why Are We Using Rollup.js?

  • Represents the next generation of build tools in terms of its performance (build time), intermediate configuration (less complicated than webpack but more involved than Parcel), and optional but out-of-the-box features likes source maps, and not using a .babelrc.
  • Rich ecosystem of plugins for file loading/dev servers
  • Code splitting
  • Tree shaking (live code inclusion / dead code elimination)
  • esnext:main entry in package.json to import es2015+ (renamed to ‘module’)
  • Scope hoisting
  • Simple API
  • Since codebase is ES2015 modules and we're making something to be used by other people

Reference: Rollup v. Webpack v. Parcel by Adam Gerard

About

JS utility wrapper for places category taxonomy

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/By2225/StreetCred_categories

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy