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

@northsh/pysigma-node

v0.1.1

Published

Run the Python pySigma library in Node.js and the browser via Pyodide (WebAssembly). Convert Sigma detection rules to SIEM queries with zero native dependencies.

Downloads

248

Readme

@northsh/pysigma-node

Run the Python pySigma library in Node.js and the browser via Pyodide (WebAssembly), and convert Sigma detection rules into SIEM queries — with zero native dependencies.

  • Works in Node.js, Bun, Deno, and browsers.
  • Runs the real upstream pySigma + backends (Splunk, Elasticsearch, Loki, Kusto, Panther, …) installed on demand via micropip.
  • Optional Web Worker support to keep the browser UI thread responsive.
  • The Python glue code is inlined — no asset files to copy at runtime.

Installation

npm install @northsh/pysigma-node pyodide

pyodide is a peer dependency so you control its version and how it is served.

Quick start (Node.js)

import { SigmaConverter } from "@northsh/pysigma-node";

const converter = new SigmaConverter(); // runs Pyodide in-process

const rule = `
title: Whoami Execution
logsource:
  category: process_creation
  product: windows
detection:
  selection:
    Image|endswith: '\\\\whoami.exe'
  condition: selection
`;

const { query, error } = await converter.convert(rule, "splunk");
console.log(error ?? query);

The first conversion downloads Pyodide and installs pySigma + the requested backend, so it takes a few seconds. Subsequent calls are fast.

Browser with a Web Worker (recommended)

Spawn the bundled worker entry and pass it to the converter:

import { SigmaConverter } from "@northsh/pysigma-node";

const worker = new Worker(
  new URL("@northsh/pysigma-node/worker", import.meta.url),
  { type: "module" },
);

const converter = new SigmaConverter({ worker });
const { query } = await converter.convert(rule, "esql");

In the browser (and without an indexURL override) Pyodide is loaded from the jsDelivr CDN. In Node.js the locally installed pyodide package is used.

API

new SigmaConverter(options?)

| Option | Type | Description | | ------------------ | ------------------------- | --------------------------------------------------------------------------- | | worker | Worker | Offload work to a Web Worker. Omit to run in-process (Node). | | transport | SigmaTransport | Provide a custom transport (overrides worker). Useful for testing. | | targets | Map<string, SigmaTarget>| Custom target → backend registry. Defaults to DEFAULT_SIGMA_TARGETS. | | pysigmaVersion | string | pySigma version to install (default pinned). | | pipelinePackages | string[] | Pipeline packages to install at bootstrap. | | indexURL | string | Override the Pyodide indexURL. | | onStatus | (status) => void | Status callback. |

Methods:

  • convert(rule, target, pipelines?, pipelineYmls?, filterYml?, format?, correlationMethod?, backendOptions?)Promise<{ query, error? }>
  • installBackend(target) → preinstall a backend.
  • getAvailablePipelines(target) → list compatible pipeline names.
  • addStatusListener(fn) / addReadinessListener(fn) → subscribe to lifecycle.
  • isReady() / getStatus() / dispose().

Low-level core

For full control, use the engine directly (no transport layer):

import { PyodideSigmaEngine } from "@northsh/pysigma-node/core";

const engine = new PyodideSigmaEngine();
await engine.init();
const { result } = await engine.convert({ rule, target: "loki" });

Supported targets

A framework-agnostic registry of common targets ships as DEFAULT_SIGMA_TARGETS (Splunk, Elasticsearch ES|QL/Lucene/EQL, Loki, Kusto, Panther, Google SecOps, SentinelOne, SQLite, SurrealQL, QuickWit, CrowdStrike Logscale, DataDog, NetWitness, Carbon Black, uberAgent). Provide your own via the targets option.

License

MIT