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

@bit3x/search-community

v0.2.0

Published

```sh npm install @bit3x/search-community # or yarn add @bit3x/search-community ```

Downloads

9

Readme

README

Install

npm  install @bit3x/search-community
# or
yarn add     @bit3x/search-community

Usage

const CommunitySearch = require("@bit3x/search-community");

const foursquare_client_id = "CLIENT_ID";

const foursquare_client_secret = "CLIENT_SECRET";

const redis_config = {
  port: 6379,
  host: "HOST",
  key_prefix: "foo_bar:",
  db_num: 1,
  password: "PASSWORD" // OR "" for empty password
};

const cs = new CommunitySearch(
  foursquare_client_id,
  foursquare_client_secret,
  redis_config
);

// wait for a while, wait for redis loading
async function f() {
  try {
    // if empty keyword, set ""
    // lang can be "en", "es", "ja" or any locale code at https://developer.foursquare.com/docs/api/configuration/internationalization
    const places_in_map_view = await cs.get_places_in_map_view(
      south_west_coordinate_latitude,
      south_west_coordinate_longitude,
      north_east_coordinate_latitude,
      north_east_coordinate_longitude,
      keyword,
      lang
    );

    // if empty keyword, set ""
    // lang can be "en", "es", "ja" or any locale code at https://developer.foursquare.com/docs/api/configuration/internationalization
    const places_in_large_area_search = await cs.get_places_in_hugearea_with_keyword(
      center_coordinate_latitude,
      center_coordinate_longitude,
      keyword,
      lang
    );

    // the result of these 2 functions will be the array (can be empty array) of :
    const each_item = {
      id: "5a1e564289e4900ae20f809f",
      name: "Finolab",
      location: {
        address: "大手町1-6-1",
        crossStreet: "大手町ビルヂング 4F",
        lat: 35.68597939729372,
        lng: 139.76588023566188,
        labeledLatLngs: [
          { label: "display", lat: 35.68597939729372, lng: 139.76588023566188 }
        ],
        postalCode: "100-0004",
        cc: "JP",
        neighborhood: "千代田区",
        city: "Tokyo",
        state: "Tokyo",
        country: "Japan",
        formattedAddress: [
          "大手町1-6-1 (大手町ビルヂング 4F)",
          "Chiyoda, Tokyo",
          "100-0004",
          "Japan"
        ]
      },
      categories: [
        {
          id: "4bf58dd8d48988d174941735",
          name: "Coworking Space",
          pluralName: "Coworking Spaces",
          shortName: "Coworking Space",
          icon: {
            prefix:
              "https://ss3.4sqi.net/img/categories_v2/building/office_coworkingspace_",
            suffix: ".png"
          },
          primary: true
        }
      ],
      referralId: "v-1583674926",
      hasPerk: false
    };
  } catch (err) {
    console.error(err);
  }
}