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

@osohq/dev-server

v0.0.1-alpha.17

Published

Utilities for running the Oso Dev Server from a Node.js application.

Downloads

49,831

Readme

NodeJS Dev Server

This package provides convenient access to the Oso Cloud Dev Server via a NodeJS package.

The package contains the following features:

  • Downloads and installs the relevant Dev Server as a postinstall script. (See versioning).
  • Exposes the dev server as a Node binary (e.g. run with npx @osohq/dev-server).
  • Provides functions for managing an in-process version of the Dev Server, with convenience functions for getting ephemeral test keys.

Usage

This is primarily designed for usage in tests, for example, Jest tests using this might look like:

import { glob } from "glob";
import { Oso } from "oso-cloud";
import {
  configureDevServer,
  getEphemeralOsoKey,
  stopRunningInstance,
} from "@osohq/dev-server";

async function testOso() {
  const { url, apiKey } = await getEphemeralOsoKey();
  const oso = new Oso(url, apiKey);
}

describe("Oso tests", () => {
  beforeAll(async () => {
    // load all policy files on starting the server
    // these will be copied into each ephmeral test
    // instance
    const policyFiles = await glob("**/*.polar");
    await configureDevServer({ policyFiles });
  })

  afterEach(async () => {
    try {
      // clean up any instances if they're still running
      await stopRunningInstance();
    } catch (e) {
      // ignore
    }
  });

  it("can get list results back", async () => {
    const oso = await testOso();
    const results = await oso.list(
      { type: "User", id: "alice" },
      "read",
      "Foo"
    );

    expect(results).toEqual(["123"]);
  });
});

Versioning

Versions of this package have two components:

  1. The package version, e.g. 0.0.1
  2. The version of the Dev Server it links by default, e.g. 1.10.6 -- captured as a build version.

e.g. version 0.0.1 built to link against 1.10.6 is versioned as 0.0.1+1.10.6.

If you wish to override the Dev Server build, you can do so by specifying the environment variable OSO_DEV_SERVER_VERSION

Development

  • Install dependencies with: yarn --ignore-scripts
    • The --ignore-scripts flag is necessary to avoid running the postinstall script, which depends on the ./dist directory being present.
  • Build the package with: yarn build
  • Publish via yarn publish
    • Make sure you're a member of the @osohq organization on npm and logged in locally.