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 🙏

© 2025 – Pkg Stats / Ryan Hefner

location-data

v1.0.1

Published

This is a plugin for [Strapi](https://strapi.io/) that adds a custom location field. Simply type in a location and select it from an autocomplete dropdown list. The autocomplete functionality is powered by the Google Places API, which requires an API key.

Readme

Strapi Location Field Plugin

This is a plugin for Strapi that adds a custom location field. Simply type in a location and select it from an autocomplete dropdown list. The autocomplete functionality is powered by the Google Places API, which requires an API key.

Strapi Interface

image

API Response

image

Installation

To install this package, run the following command in an existing strapi project:

npm install strapi-location

Usage

To enable the plugin, you'll need to include the following code in your Strapi project, in the /config/plugins.js file:

module.exports = ({ env }) => ({
	"location-data": {
		enabled: true,
		config: {
			fields: ["photo", "rating"], // optional
			// You need to enable "Autocomplete API" and "Places API" in your Google Cloud Console
			googleMapsApiKey: env("GOOGLE_MAPS_API_KEY"),
			// See https://developers.google.com/maps/documentation/javascript/reference/places-autocomplete-service#AutocompletionRequest
			autocompletionRequestOptions: {},
		},
	},
	// .. your other plugin configurations
});

Make sure to add a line to your .env with your Google Maps API Key. You must have the Places API enabled.

GOOGLE_MAPS_API_KEY=your-api-key

Note: the config.fields value can be set to an array of options (strings) containing any fields you'd like to be returned. The options that Google allows can be found here or in the screenshot below. When set, the information relevant to those specific fields will be accessible in the API response under the "details" key. The geometry field is always enabled.

image

ℹ️ Please note: some fields may not return the expected response. Currently only the photo, rating, and geometry fields have been tested.

autocompletionRequestOptions allows you to customize the search behavior by overriding the options used when autocompletion requests are made. The Autocomplete API documentation lists all the available options. For example, this configuration returns autocomplete results in Spanish and biases the search closer to the caller's IP address:

{
  config: {
    googleMapsApiKey: env("GOOGLE_MAPS_API_KEY"),
    autocompletionRequestOptions: {
      language: 'es',
      locationBias: 'IP_BIAS',
    },
  },
}

You'll also need to modify the /config/middlewares.js file

module.exports = [
  "strapi::errors",
  {
    name: "strapi::security",
    config: {
      contentSecurityPolicy: {
        directives: { "script-src": ["'self'", "'unsafe-inline'", "maps.googleapis.com"] },
      },
    },
  },
  "strapi::cors",
  "strapi::poweredBy",
  "strapi::logger",
  "strapi::query",
  "strapi::body",
  "strapi::session",
  "strapi::favicon",
  "strapi::public",
];

After installation and configuration, build the project with npm run build or yarn build