Socket
Socket
Sign inDemoInstall

@streetcredlabs/categories

Package Overview
Dependencies
5
Maintainers
3
Versions
24
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @streetcredlabs/categories

JS utility wrapper for places category taxonomy


Version published
Weekly downloads
0
decreased by-100%
Maintainers
3
Created
Weekly downloads
 

Readme

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": [...]
  },
  ...
]

getCompleteness

Determines how complete a place is based on our scoring system.

import { getCompleteness } from '@streetcredlabs/categories';
const place = funcThatGetsAStandardPlaceObj();
console.log(getCompleteness(place)); // 0.75

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

Run tests and watch for changes:

yarn test-watch
Run tests once:
yarn test

Run build and watch for changes:

yarn start
Run build once:
yarn build

Releasing

Release a new version of this module based off the version in package.json. Note you will need to have publish access to the streetcredlabs npm account and be authenticated.

yarn release

The script does a few things:

  • Builds the dist version with yarn build (⚠️ NOTE: This needs improvement. Right now, if this results in changes, they won't be committed and it could be weird)
  • Creates a new git tag from the package.json version
  • Attempts to publish to npm with npm publish

FAQs

Last updated on 03 Jul 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc