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

node-ikev2

v0.2.1

Published

IKEv2 parser and serializer for Node.js

Readme

IKEv2 Parser

A TypeScript parser for Internet Key Exchange Version 2 (IKEv2) protocol, designed to parse, manipulate, and serialize IKEv2 packets based on RFC 7296. This parser breaks down IKEv2 messages into modular components, including headers, payloads, transforms, and proposals, for detailed inspection and modification.

Features

• Parsing of IKEv2 Packets: Parse incoming IKEv2 packets into a readable structure like JSON.

• Modular Architecture: Separate classes for headers, payloads, transforms, and proposals for ease of use and extension.

• Serialization: Convert structured IKEv2 data back into its original binary format for transmission.

Project Structure

Header: Manages parsing and serialization of the IKEv2 header.

Payload: Represents individual IKEv2 payloads. Different types of payloads (e.g., SA, KE, AUTH) are represented by dedicated classes, enabling specific parsing logic for each type.

Transform & Proposal: Contains structures for handling proposals and transforms within the IKEv2 SA payload, supporting complex configurations and transformations.

Message: The main class to parse and serialize IKEv2 messages, which combines the header and payloads.

Installation

npm install node-ikev2

Usage

Import the necessary classes and use the parser to handle IKEv2 packets. Here's a quick example:

import { Message } from "node-ikev2";

// Example hex string representing an IKEv2 packet
const packetHex = "800e0080...";
const packetBuffer = Buffer.from(packetHex, "hex");

// Parsing the packet
const message = Message.parse(packetBuffer);

// Inspecting the parsed message
console.log("Parsed Message:", message.toJSON());

// Modifying a payload (if necessary)
message.header.version = 2; // Modify as needed

// Serializing the message back to binary format
const serialized = message.serialize();
console.log("Serialized Packet (hex):", serialized.toString("hex"));

Testing

Tests are written using Jest. To run tests:

npm test

Building, Development and Testing

Clone this repository, then...

npm install
npm run build-and-test

Tests cover various cases, including parsing and serialization, to ensure reliability and stability.

Sample IKEv2 Wireshark Pcap

You can check the IKEv2 messages and their content in this Pcap sample from Wireshark:

Sample IKEv2 Wireshark Pcap

Contributing

Contributions are welcome! To contribute:

  1. Fork the repository.
  2. Create a new branch for your feature or bugfix.
  3. Write tests for any new functionality.
  4. Open a pull request with a clear description of changes.