Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@streetcredlabs/categories

Package Overview
Dependencies
Maintainers
3
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@streetcredlabs/categories

JS utility wrapper for places category taxonomy

  • 2.3.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
3
Weekly downloads
 
Created
Source

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

FAQs

Package last updated on 19 Dec 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc