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 🙏

© 2026 – Pkg Stats / Ryan Hefner

scribo-maps

v1.0.7

Published

Embeddable map widget for store locators

Downloads

87

Readme

🗺️ Scribo Maps

An embeddable, responsive map widget for store locators and location-based applications. Built with Google Maps API and designed for easy integration into any website.

NPM Version NPM Downloads License: MIT

✨ Features

  • 🌍 Interactive Google Maps with marker clustering
  • 🔍 Smart search with Google Places autocomplete
  • 📍 Geolocation support for finding nearby locations
  • 🏪 Sidebar with location details and "Get Directions" links
  • 🌐 Multi-language support (English, Portuguese)
  • 📱 Fully responsive design
  • 🎨 Beautiful, modern UI with smooth animations
  • Lightweight (~17KB total, ~11KB minified)
  • 🚀 Easy integration - just a few lines of code

🚀 Quick Start

<!DOCTYPE html>
<html>
<head>
    <!-- Scribo Maps CSS -->
    <link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/scribo-maps.min.css">
</head>
<body>
    <div id="map-container" style="height: 500px;"></div>
    
    <!-- Dependencies -->
    <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_GOOGLE_MAPS_KEY&libraries=places"></script>
    <script src="https://unpkg.com/@googlemaps/markerclusterer/dist/index.min.js"></script>
    
    <!-- Scribo Maps JS -->
    <script src="https://unpkg.com/[email protected]/dist/scribo-maps.min.js"></script>
    
    <!-- Initialize -->
    <script>
        new ScriboMap('map-container', {
            locale: 'en-US', // or 'pt-BR'
            locations: [
                {
                    name: "Store Location",
                    address: "123 Main St, City",
                    lat: 40.7128,
                    lng: -74.0060,
                    image: "https://example.com/store-image.jpg"
                }
            ]
        });
    </script>
</body>
</html>

📖 API Reference

Constructor

new ScriboMap(elementId, config)

Parameters

  • elementId string - ID of the HTML element to render the map
  • config object - Configuration object

Configuration Object

{
    locale: 'en-US', // 'en-US' or 'pt-BR'
    locations: [     // Array of location objects
        {
            name: 'Store Name',        // Required: Display name
            address: 'Full Address',   // Optional: Full address string
            lat: 40.7128,             // Required: Latitude
            lng: -74.0060,            // Required: Longitude
            image: 'image-url.jpg'    // Optional: Store image URL
        }
    ]
}

Methods

const map = new ScriboMap('container', config);

// Change language dynamically
map.setLocale('pt-BR');

// Get currently displayed locations
const visibleLocations = map.getCurrentlyDisplayedLocations();

🌐 Internationalization

Scribo Maps supports multiple languages:

English (en-US)

new ScriboMap('map', {
    locale: 'en-US',
    locations: [...]
});

Portuguese (pt-BR)

new ScriboMap('map', {
    locale: 'pt-BR',
    locations: [...]
});

🎨 Customization

Custom Styling

Override CSS variables to match your brand:

:root {
    --scribo-primary-color: #your-brand-color;
    --scribo-border-radius: 12px;
    --scribo-sidebar-width: 380px;
}

Responsive Design

The widget automatically adapts to different screen sizes:

  • Desktop: Full sidebar + map view
  • Mobile: Optimized sidebar width and spacing

📦 File Structure

When you install or use via CDN, you get:

scribo-maps/
├── dist/
│   ├── scribo-maps.js          # Source (16KB)
│   ├── scribo-maps.min.js      # Minified (11KB)
│   ├── scribo-maps.css         # Source styles (8KB)
│   ├── scribo-maps.min.css     # Minified styles (6KB)
│   └── scribo-maps.min.js.map  # Source map

🔧 Dependencies

Required

  • Google Maps JavaScript API with Places library
  • MarkerClusterer for marker clustering

Peer Dependencies

  • @googlemaps/markerclusterer: ^2.0.0

💡 Usage Examples

Basic Store Locator

new ScriboMap('store-locator', {
    locale: 'en-US',
    locations: [
        {
            name: "Downtown Store",
            address: "123 Main St, Downtown",
            lat: 40.7128,
            lng: -74.0060,
            image: "https://example.com/store1.jpg"
        },
        {
            name: "Mall Location", 
            address: "456 Shopping Center Dr",
            lat: 40.7589,
            lng: -73.9851,
            image: "https://example.com/store2.jpg"
        }
    ]
});

Restaurant Locator

new ScriboMap('restaurant-finder', {
    locale: 'pt-BR',
    locations: [
        {
            name: "Restaurante Central",
            address: "Rua Principal, 100 - Centro",
            lat: -23.5505,
            lng: -46.6333,
            image: "https://example.com/restaurant.jpg"
        }
    ]
});

Service Locations

new ScriboMap('service-locations', {
    locale: 'en-US',
    locations: [
        {
            name: "Service Center North",
            address: "789 Service Ave, North District", 
            lat: 41.8781,
            lng: -87.6298,
            image: "" // Will use placeholder icon
        }
    ]
});

🚀 CDN Options

📦 How to Deploy Your Own Version

If you want to create your own version or contribute to Scribo Maps, here's how to set up and deploy:

Prerequisites

  • Node.js 16+ and npm
  • NPM account (create at npmjs.com)
  • Google Maps API key for testing

Development Setup

  1. Clone and setup:
git clone https://github.com/scribo-dev/scribo-maps.git
cd scribo-maps
npm install
  1. Build the project:
npm run build

This creates minified files in the dist/ folder:

  • scribo-maps.min.js (11KB)
  • scribo-maps.min.css (6KB)
  • Source maps for debugging
  1. Test locally:
# Open index.html in your browser
# Or serve with a local server
npx serve .

Publishing to NPM

  1. Login to NPM:
npm login
  1. Update version (if needed):
npm version patch  # 1.0.0 → 1.0.1
npm version minor  # 1.0.0 → 1.1.0
npm version major  # 1.0.0 → 2.0.0
  1. Publish:
npm publish

The prepublishOnly script automatically builds fresh minified files before publishing.

What Gets Published

Your NPM package will include:

  • dist/scribo-maps.js - Source JavaScript (16KB)
  • dist/scribo-maps.min.js - Minified JavaScript (11KB)
  • dist/scribo-maps.css - Source CSS (8KB)
  • dist/scribo-maps.min.css - Minified CSS (6KB)
  • dist/scribo-maps.min.js.map - Source map for debugging
  • package.json - Package metadata

CDN Availability

Once published, your package is automatically available on:

  • unpkg: https://unpkg.com/your-package@version/dist/
  • jsDelivr: https://cdn.jsdelivr.net/npm/your-package@version/dist/

Files are available within minutes of publishing!

Build Scripts

npm run clean        # Remove dist/ folder
npm run build:js     # Minify JavaScript with source maps
npm run build:css    # Minify CSS  
npm run build        # Complete build process

Package Structure

scribo-maps/
├── 📁 Source files (committed to git)
│   ├── scribo-maps.js      ← Main JavaScript
│   ├── scribo-maps.css     ← Main stylesheet
│   ├── index.html          ← Demo page
│   └── package.json        ← NPM configuration
│
├── 📁 dist/ (ignored by git, published to NPM)
│   ├── scribo-maps.js      ← Source copy
│   ├── scribo-maps.css     ← Source copy  
│   ├── scribo-maps.min.js  ← Minified JS
│   ├── scribo-maps.min.css ← Minified CSS
│   └── *.js.map            ← Source maps
│
└── 📁 node_modules/ (ignored)

Best Practices

  • Test before publishing with npm run build
  • Use semantic versioning for updates
  • Update README for major changes
  • Keep source files clean (dist/ is auto-generated)
  • Test on multiple CDNs after publishing

🌟 Browser Support

  • ✅ Chrome 60+
  • ✅ Firefox 55+
  • ✅ Safari 12+
  • ✅ Edge 79+
  • ✅ Mobile browsers (iOS Safari, Chrome Mobile)

📱 Mobile Features

  • Touch-friendly interface
  • Responsive sidebar
  • Optimized marker clustering
  • Smooth pan and zoom
  • Native "Get Directions" integration

🔐 Security

  • No API keys hardcoded
  • Client provides their own Google Maps API key
  • Content Security Policy friendly
  • XSS protection built-in

⚡ Performance

  • Lazy loading of map tiles
  • Marker clustering for large datasets
  • Debounced search to reduce API calls
  • Minified assets for fast loading
  • CDN delivery for global performance

🐛 Troubleshooting

Common Issues

Map not showing:

  • Check that your Google Maps API key is valid
  • Ensure the Places library is included: &libraries=places
  • Verify the container element exists

Locations not appearing:

  • Check that lat/lng coordinates are valid numbers
  • Ensure locations array is properly formatted
  • Verify API key has proper permissions

Styling issues:

  • Make sure CSS file is loaded before JS
  • Check for CSS conflicts with your site's styles
  • Verify container has a defined height

📄 License

MIT License - see LICENSE file for details.

🤝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📞 Support

🏆 Showcase

Using Scribo Maps in your project? Let us know and we'll feature it here!


Made with ❤️ by the Scribo team

Scribo Maps - Making location-based applications simple and beautiful.