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

@sentriflow/core

v0.4.2

Published

SentriFlow core engine for network configuration validation

Readme

@sentriflow/core

Core engine for SentriFlow - a network configuration validator.

Overview

@sentriflow/core provides the fundamental building blocks for parsing and analyzing network device configurations across multiple vendors, validating them against policy rules—whether industry best practices or your organization's specific requirements.

SentriFlow is a validation tool that assesses configuration alignment with policies and standards.

Installation

npm install @sentriflow/core
# or
bun add @sentriflow/core

Features

  • Multi-vendor support: Cisco IOS/NX-OS, Juniper JunOS, Arista EOS, Fortinet FortiGate, Palo Alto PAN-OS, and more
  • AST-based parsing: Converts configurations into a vendor-agnostic Abstract Syntax Tree
  • Extensible rule engine: Define validation rules for best practices or organization-specific policies
  • IP/Subnet Extraction: Extract and deduplicate IP addresses and CIDR subnets from configurations
  • GRX2 Loader: Load and decrypt extended encrypted rule packs for offline usage
  • TypeScript native: Full type safety with comprehensive type definitions

Supported Vendors

| Vendor | Platform | Status | |--------|----------|--------| | Cisco | IOS, IOS-XE, NX-OS | Supported | | Juniper | JunOS | Supported | | Arista | EOS | Supported | | Fortinet | FortiGate | Supported | | Palo Alto | PAN-OS | Supported | | Nokia | SR-OS | Supported | | Huawei | VRP | Supported | | MikroTik | RouterOS | Supported | | Cumulus | Linux | Supported | | VyOS | VyOS | Supported | | Extreme | EXOS | Supported | | Aruba | AOS-CX | Supported |

Basic Usage

import { parse, validate } from '@sentriflow/core';
import { defaultRules } from '@sentriflow/rules-default';

// Parse a configuration file
const config = `
interface GigabitEthernet0/1
  ip address 192.168.1.1 255.255.255.0
  no shutdown
`;

const ast = parse(config, { vendor: 'cisco-ios' });

// Check compliance against rules
const results = validate(ast, defaultRules);

for (const issue of results) {
  console.log(`${issue.severity}: ${issue.message}`);
}

API Reference

parse(config: string, options: ParseOptions): AST

Parses a network configuration string into an AST.

validate(ast: AST, rules: Rule[]): ValidationResult[]

Checks an AST for compliance against a set of rules.

detect(config: string): VendorInfo | null

Auto-detects the vendor/platform from configuration content.

extractIPSummary(content: string, options?: ExtractOptions): IPSummary

Extracts all IP addresses and subnets from configuration text.

import { extractIPSummary } from '@sentriflow/core';

const config = `
interface GigabitEthernet0/1
  ip address 192.168.1.1 255.255.255.0
  ip route 10.0.0.0/24 via 192.168.1.254
`;

const summary = extractIPSummary(config);
// {
//   ipv4Addresses: ['192.168.1.1', '192.168.1.254'],
//   ipv6Addresses: [],
//   ipv4Subnets: ['10.0.0.0/24'],
//   ipv6Subnets: [],
//   counts: { total: 3, ipv4: 2, ipv6: 0, ipv4Subnets: 1, ipv6Subnets: 0 }
// }

Options:

  • maxContentSize: Maximum input size in bytes (default: 50MB) - prevents DoS
  • includeSubnetNetworks: Include subnet network addresses in address lists
  • skipIPv4, skipIPv6, skipSubnets: Skip specific extraction types

GRX2 Loader Module

The grx2-loader module provides functionality for loading extended encrypted rule packs (.grx2). These packs embed wrapped encryption keys, enabling offline scanning without network access.

Exported Functions

import {
  loadExtendedPack,
  loadAllPacks,
  getPackInfo,
  getMachineId,
  getMachineIdSync,
  isExtendedGRX2,
} from '@sentriflow/core/grx2-loader';

| Function | Description | |----------|-------------| | loadExtendedPack(filePath, licenseKey, machineId?) | Load and decrypt a single GRX2 pack | | loadAllPacks(directory, licenseKey, machineId?) | Load all GRX2 packs from a directory | | getPackInfo(filePath) | Get metadata from a pack without decrypting | | getMachineId() | Get the current machine identifier (async) | | getMachineIdSync() | Get the current machine identifier (sync) | | isExtendedGRX2(buffer) | Check if a buffer contains an extended GRX2 pack |

Types

import type {
  GRX2ExtendedHeader,
  GRX2PackLoadResult,
  EncryptedPackInfo,
  EncryptedPackErrorCode,
  LicensePayload,
} from '@sentriflow/core/grx2-loader';

import { EncryptedPackError } from '@sentriflow/core/grx2-loader';

Example Usage

import { loadExtendedPack, getMachineId } from '@sentriflow/core/grx2-loader';

const licenseKey = process.env.SENTRIFLOW_LICENSE_KEY;
const machineId = await getMachineId();

try {
  const result = await loadExtendedPack('./rules.grx2', licenseKey, machineId);
  if (result.success) {
    console.log(`Loaded ${result.totalRules} rules`);
  }
} catch (error) {
  if (error instanceof EncryptedPackError) {
    console.error(`Pack error: ${error.code} - ${error.message}`);
  }
}

Machine-Bound vs Portable Packs

  • Portable packs: Pass empty string for machineId parameter
  • Machine-bound packs: Pass the result of getMachineId() for device-specific binding

Related Packages

Disclaimer

SentriFlow provides automated configuration validation. Validation results do not constitute compliance certification.

License

Apache-2.0