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

@vepler/safety-types

v3.17.1

Published

TypeScript type definitions for Vepler Safety Service API

Readme

Public API Types - Route-based Organisation

📝 Description

This TypeScript library provides comprehensive type definitions for the Vepler Safety Service API. The service offers location-based crime statistics, safety metrics, and neighbourhood watch data across England and Wales. Our API enables developers to query crime data by geographic area, analyze crime trends over time, calculate crime scores, and access neighbourhood watch scheme information.

The type library follows a route-based organisation structure, with each API endpoint having dedicated request and response types. This approach ensures type safety, improved developer experience, and seamless integration with the Vepler Safety Service.

📁 Folder Structure

src/types/public/
├── routes/
│   ├── catalog/
│   │   ├── index.ts
│   │   └── get-catalog.ts
│   ├── crime/
│   │   ├── index.ts
│   │   ├── get-area-stats.ts
│   │   ├── get-category-stats.ts
│   │   └── get-crime-data.ts
│   ├── geography/
│   │   ├── index.ts
│   │   └── get-metrics.ts
│   ├── neighborhood-watch/
│   │   ├── index.ts
│   │   ├── get-by-area.ts
│   │   ├── get-by-location.ts
│   │   └── get-scheme-details.ts
│   └── index.ts
├── index.ts
└── README.md

🎯 Usage Examples

// Namespace import (recommended)
import { CatalogTypes, CrimeTypes, GeographyTypes, NeighborhoodWatchTypes } from '@vepler/safety-types';

// Specific import
import { GetCatalogQueryParams, GetCatalogResponse } from '@vepler/safety-types/routes/catalog';

// Direct route import
import { GetMetricsQueryParams, GetMetricsResponse } from '@vepler/safety-types/routes/geography';

📋 Route Coverage

/api/catalog

  • Get Catalog: Retrieve available data periods and processing status by country

/api/crime

  • Get Area Stats: Area-based crime statistics with boundary data
  • Get Category Stats: Crime statistics grouped by category and time period
  • Get Crime Data: Individual crime incident data with location details

/api/geography

  • Get Metrics: Comprehensive geographic crime metrics with time series and percentage changes

/api/neighborhood-watch

  • Get By Area: Neighborhood watch schemes within specific geographic areas
  • Get By Location: Proximity-based search for neighborhood watch schemes
  • Get Scheme Details: Detailed information about specific neighborhood watch schemes

🔧 Type Design Principles

Route-based organisation: Each API route has its own namespace with dedicated request/response types • Consistent naming: All types follow {EndpointName}QueryParams and {EndpointName}Response conventions • Error handling: Standardised {RouteName}ErrorResponse types for each route namespace • Type safety: Explicit TypeScript interfaces with comprehensive JSDoc documentation • Modern standards: Current API specifications with clean, consistent interfaces • Extensibility: Modular structure allows easy addition of new routes and endpoints

🚀 Benefits

Route isolation: Types are organised by API route, making them easier to locate and maintain • Namespace clarity: Import exactly what you need without type name conflicts • IntelliSense support: Full autocomplete and type checking in modern IDEs • Documentation: Rich JSDoc comments provide context and usage examples • Stable contracts: Well-defined API interfaces ensure consistent integration experience • Build safety: TypeScript compilation failures prevent deployment of broken type definitions • Validation ready: Types designed to work seamlessly with runtime validation libraries • Future-proof: Scalable structure ready for new API endpoints and features

📦 Publishing

Build the types library:

pnpm build:types

Import in your project:

import { GeographyTypes } from '@vepler/safety-types';
// or
import { GetMetricsQueryParams } from '@vepler/safety-types/routes/geography';