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

@onlineapps/cookbook-transformer

v1.1.5

Published

OpenAPI to cookbook transformation and mapping - handles API spec analysis and conversion

Readme

@onlineapps/cookbook-transformer

OpenAPI to cookbook transformation and mapping - handles API spec analysis and conversion.

Overview

This package provides transformation utilities between OpenAPI specifications and cookbook workflow definitions. It analyzes API specs, generates cookbook steps, and maps between different formats.

Installation

npm install @onlineapps/cookbook-transformer

Features

  • OpenAPI spec analysis - Extract operations, schemas, and dependencies
  • Cookbook generation - Auto-generate workflows from API specs
  • Step translation - Convert between cookbook steps and API calls
  • Response mapping - Transform API responses to workflow outputs
  • JSONPath support - Advanced data mapping capabilities

Usage

Generate cookbook from OpenAPI

const { CookbookGenerator } = require('@onlineapps/cookbook-transformer');

const generator = new CookbookGenerator({
  defaultTimeout: 10000,
  defaultRetry: {
    maxAttempts: 3,
    delayMs: 2000
  }
});

const openApiSpec = require('./api-spec.json');
const cookbook = generator.generate(openApiSpec);

Analyze API specification

const { ApiSpecAnalyzer } = require('@onlineapps/cookbook-transformer');

const analyzer = new ApiSpecAnalyzer();
const analysis = analyzer.analyze(openApiSpec);

console.log(analysis.summary);
// { totalEndpoints: 10, tags: ['users', 'products'], ... }

Translate cookbook steps to API calls

const { StepTranslator } = require('@onlineapps/cookbook-transformer');

const translator = new StepTranslator(openApiSpec);

const apiCall = translator.translateToApiCall({
  type: 'task',
  service: 'user-service',
  operation: 'getUser',
  input: { id: '123' }
});

Map API responses

const { ResponseMapper } = require('@onlineapps/cookbook-transformer');

const mapper = new ResponseMapper();

const output = mapper.mapResponse(
  apiResponse,
  {
    userId: '$.data.id',
    userName: '$.data.attributes.name',
    email: '$.data.attributes.email'
  }
);

API Reference

CookbookGenerator

Generate cookbook workflows from OpenAPI specs:

const generator = new CookbookGenerator(options);
const cookbook = generator.generate(openApiSpec, options);

Options:

  • defaultTimeout - Default timeout for operations (ms)
  • defaultRetry - Default retry configuration
  • includeOptionalParams - Include optional parameters
  • generateExamples - Generate example values

ApiSpecAnalyzer

Analyze OpenAPI specifications:

const analyzer = new ApiSpecAnalyzer();
const analysis = analyzer.analyze(spec);

Returns:

  • summary - Overview statistics
  • endpoints - Detailed endpoint information
  • schemas - Data schemas
  • dependencies - Operation dependencies

StepTranslator

Translate between cookbook steps and API calls:

const translator = new StepTranslator(spec);
const apiCall = translator.translateToApiCall(step);
const step = translator.translateFromApiCall(apiCall);

ResponseMapper

Map API responses to cookbook outputs:

const mapper = new ResponseMapper();
const output = mapper.mapResponse(response, mapping);
const transformed = mapper.transform(data, schema);

Mapping Examples

Simple field mapping

{
  "name": "$.user.name",
  "email": "$.user.email",
  "id": "$.user.id"
}

Array mapping

{
  "items": "$.data[*].id",
  "count": "$.data.length",
  "firstItem": "$.data[0]"
}

Complex transformations

{
  "fullName": {
    "$concat": ["$.firstName", " ", "$.lastName"]
  },
  "isActive": {
    "$equals": ["$.status", "active"]
  }
}

Related Packages

  • @onlineapps/cookbook-core - Core parsing and validation
  • @onlineapps/cookbook-executor - Workflow execution engine
  • @onlineapps/cookbook-router - Message routing
  • @onlineapps/connector-cookbook - Full-featured wrapper

License

PROPRIETARY - All rights reserved