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

@aziontech/types

v1.0.0

Published

Global types for Azion packages

Readme

Azion Types

The Types package provides global TypeScript types that are used across Azion platform, ensuring consistency and reducing redundancy throughout the codebase.

⚠️ These types are specifically tailored for Azion Runtime environments.

Table of Contents

Installation

Install the package using npm or yarn:

npm install azion

or

yarn add azion

Usage

Defining Metadata

The Metadata interface provides a structured way to represent request metadata, including GeoIP information, remote address details, and server/TLS data.

TypeScript Example:

import { Metadata } from '@aziontech/types';

const requestMetadata: Metadata = {
  geoip_asn: '12345',
  geoip_city: 'Sao Paulo',
  geoip_city_continent_code: 'SA',
  geoip_city_country_code: 'BR',
  geoip_city_country_name: 'Brazil',
  geoip_continent_code: 'SA',
  geoip_country_code: 'BR',
  geoip_country_name: 'Brazil',
  geoip_region: 'SP',
  geoip_region_name: 'Sao Paulo',
  remote_addr: '192.0.2.1',
  remote_port: '443',
  remote_user: 'user',
  server_protocol: 'HTTP/1.1',
  ssl_cipher: 'ECDHE-RSA-AES128-GCM-SHA256',
  ssl_protocol: 'TLSv1.2',
};

Working with FetchEvent

The FetchEvent interface extends the standard Event interface to include request and metadata properties, providing a complete context for handling fetch operations in the Azion environment.

TypeScript Example:

import { FetchEvent, Metadata } from '@aziontech/types';

addEventListener('fetch', (event: FetchEvent) => {
  const { request } = event;
  const metadata: Metadata = request.metadata;

  console.log('Request URL:', request.url);
  console.log('Client IP:', metadata.remote_addr);
  console.log('GeoIP City:', metadata.geoip_city);

  event.respondWith(fetch(request));
});

Handling FirewallEvent

The FirewallEvent interface provides additional methods specific to firewall events, allowing for actions like denying requests, dropping connections, or adding headers to requests and responses.

TypeScript Example:

import { FirewallEvent } from '@aziontech/types';

addEventListener('firewall', (event: FirewallEvent) => {
  const { request } = event;

  console.log('Request URL:', request.url);
  console.log('GeoIP Country:', request.metadata.geoip_country_name);

  if (request.metadata.geoip_country_code === 'CN') {
    event.deny();
  } else {
    event.continue();
  }
});

API Reference

Metadata

The Metadata interface represents metadata information for requests, including GeoIP data, remote address, server protocol, and TLS information.

FetchEvent

The FetchEvent interface extends the standard Event interface and includes the request object and methods to handle fetch events within the Azion Runtime.

FirewallEvent

The FirewallEvent interface extends the standard Event interface and includes methods to manage firewall events, such as denying or continuing requests and manipulating headers.

Contributing

Feel free to submit issues or pull requests to improve the functionality or documentation.