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

@vaagatech/snapline-api-adapters

v0.2.5

Published

Minimal API adapters for REST, SOAP, and GraphQL — file-driven test requests

Readme

@vaagatech/snapline-api-adapters

Minimal API adapters for REST, SOAP, and GraphQL — file-driven test requests with zero browser dependencies.

npm version License: MIT

Install

npm install @vaagatech/snapline-api-adapters

When to use

Use when you need a single, minimal way to call APIs in tests — without learning protocol-specific clients. Pick a protocol, point at a file, get normalized JSON back.

| Protocol | Best for | |----------|----------| | REST | JSON HTTP APIs | | SOAP | XML envelope services | | GraphQL | Query/mutation endpoints |

Quick demo

REST

import { api, executeApi } from '@vaagatech/snapline-api-adapters';

const result = await executeApi(
  api.rest({
    endpoint: 'https://api.example.com/users/1',
    method: 'GET',
  }),
);

console.log(result.status, result.data);

SOAP

import { api, executeApi } from '@vaagatech/snapline-api-adapters';

const result = await executeApi(
  api.soap({
    endpoint: 'https://api.example.com/soap/user',
    soapAction: 'GetUser',
    inputFile: './fixtures/soap-request.xml',
  }),
);

console.log(result.data); // parsed XML body as plain object

GraphQL

import { api, executeApi } from '@vaagatech/snapline-api-adapters';

const result = await executeApi(
  api.graphql({
    endpoint: 'https://api.example.com/graphql',
    queryFile: './fixtures/get-user.graphql',
    variablesFile: './fixtures/variables.json',
    dataPath: 'user',
  }),
);

console.log(result.data);

Factory API

import { api } from '@vaagatech/snapline-api-adapters';

api.rest({ endpoint, method, inputFile, body, headers }); // method, inputFile, body, headers optional
api.soap({ endpoint, soapAction, envelope, inputFile, headers }); // soapAction, envelope, inputFile, headers optional
api.graphql({ endpoint, query, queryFile, variables, variablesFile, dataPath, headers }); // all but endpoint optional

Configuration

REST (api.rest)

| Field | Required | Description | |-------|----------|-------------| | endpoint | Yes | URL or path (resolved with baseUrl in context) | | method | No | GET POST PUT PATCH DELETE HEAD (default GET) | | inputFile | No | JSON file used as request body | | body | No | Inline JSON body | | headers | No | Extra HTTP headers |

SOAP (api.soap)

| Field | Required | Description | |-------|----------|-------------| | endpoint | Yes | SOAP service URL | | inputFile | No | XML envelope file | | envelope | No | Inline XML envelope string | | soapAction | No | Value for SOAPAction header | | headers | No | Extra HTTP headers |

GraphQL (api.graphql)

| Field | Required | Description | |-------|----------|-------------| | endpoint | Yes | GraphQL endpoint URL | | query | One of | Inline query string | | queryFile | One of | .graphql or JSON { "query": "..." } file | | variables | No | Inline variables object | | variablesFile | No | JSON variables file | | dataPath | No | Dot-path into data (e.g. "user") | | headers | No | Extra HTTP headers |

Execute context

Pass auth headers, base URL, or DB-driven input when calling executeApi:

await executeApi(apiConfig, {
  baseUrl: 'https://api.example.com',
  authHeaders: { Authorization: 'Bearer token' },
  inputFromRow: { email: '[email protected]' }, // merged into body/variables or GET query params
});

Examples

npm install @vaagatech/snapline-api-adapters
node node_modules/@vaagatech/snapline-api-adapters/examples/rest.mjs
node node_modules/@vaagatech/snapline-api-adapters/examples/soap.mjs
node node_modules/@vaagatech/snapline-api-adapters/examples/graphql.mjs

From monorepo:

npm run build
node packages/api-adapters/examples/rest.mjs

TypeScript

import { api, executeApi, type ApiRequestConfig, type ApiExecuteResult } from '@vaagatech/snapline-api-adapters';

Module formats

| Import style | Entry | Types | |--------------|-------|-------| | ESM import | dist/index.js | dist/index.d.ts | | CJS require | dist/index.cjs | dist/index.d.cts |

Documentation

https://vaagatech.github.io/snapline/ · Python edition

Related packages

| Package | Role | |---------|------| | @vaagatech/snapline-core | Full test orchestration with api, apiToDb, dbToApi | | @vaagatech/snapline-engine | Compare API/DB results against fixtures |

License

MIT — free to use, modify, distribute, fork, and contribute.