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

active-activity-search

v0.9.0

Published

Active.com Activity Search v2 HTTP API client.

Downloads

26

Readme

active-activity-search

Active.com Activity Search v2 HTTP API client.

Build Status Code Climate js-standard-style

npm install active-activity-search --save
npm stats

npm NPM downloads Dependency Status

Example

Initialize
var client = require('active-activity-search')({
  key: '******',
  url: 'https://api.amp.active.com/v2/search' // optional as this is the default url
})
Callback
client
.query('basketball')
.category('event')
.city('Denver')
.state('CO')
.zip('80202')
.radius(50)
.search(function (error, data) {
  if (error) throw error
  console.log(data)
})
Promise
client
.query('basketball')
.category('event')
.city('Denver')
.state('CO')
.zip('80202')
.radius(50)
.search()
.then(function (data) {
  console.log(data)
})
.catch(function (error) {
  console.error(error.message)
})

Features

  • Supports all documented API query parameters.
  • Supports 12-factor configuration.
  • Accepts a traditional node-style callback otherwise, returns a promise.
  • Exposes a User-Agent request header including the name and version of the client.
  • Exposes a fluent interface.
  • Emits debug logs via DEBUG=active-activity-search*.

12-factor configuration example

ACTIVE_ACTIVITY_API_KEY="*****"
ACTIVE_ACTIVITY_API_URL="https://api.amp.active.com/v2/search" # optional as this is the default url

API

active([options])

Arguments

The following arguments can also be specified via environment variables.

  • [options]: (Object) options object.
    • [key]: (String) API key.
      • or process.env.ACTIVE_API_KEY
    • [url]: (String) API base URL.
      • or process.env.ACTIVE_API_URL
Returns
  • client: (Object) API client object.

.options() (read only)

Arguments
  • n/a
Returns
  • options: (Object) options object.

.set

Invoke corresponding accessor for each snake_cased parameter in given source object.

set({ show_suggest: true, query: 'running' })

NOTE: see http://developer.active.com/docs/read/v2_Activity_API_Search

Accessors

For each parameter a corresponding camelCased accessor (getter/setter) function is exposed.

  • All accessors are chainable.
  • Call accessor function w/o arguments and it will act as a getter.
  • Call accessor function w/ an argument and it will act as a setter.
functions
  • near
  • latLon
  • bbox
  • geoPoints
  • radius
  • showDistance
  • city
  • state
  • zip
  • country
  • query
  • currentPage
  • perPage
  • sort
  • facets
  • facetValues
  • category
  • categoryName
  • topic
  • topicName
  • metaInterest
  • metaInterestName
  • attributes
  • tags
  • startDate
  • endDate
  • cb
  • excludeChildren
  • includeEvergreenChildren
  • registerableOnly
  • exists
  • notExists
  • assetName
  • orgId
  • placeId
  • sourceSystemId
  • sourceSystemName
  • showSuggest
  • searchAgain
  • fields
  • assetGuid
  • substitutionUrl
  • authorName
  • reqMinAge
  • cityName
  • topicName

Resources

Licenses

GitHub license