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

@tooltik/aries

v0.12.0

Published

A swagger converter cli, support TypeScript declaration, request function, markdown docs, mock js and so on

Readme

npm version npm download count coverage GitHub Workflow Status license

Aries ♈️

Aries is a swagger converter cli, support typescript declaration, axios request function, markdown docs, mock server and so on

Support

Swagger 2.0, json or yaml format

Env

NodeJS >= 12

Install

# with npm
npm install @tooltik/aries --save-dev

# with yarn
yarn add @tooltik/aries --dev

# with pnpm
pnpm add @tooltik/aries --save-dev

Usage in command line

aries <command> [options]

Samples

Generate typescript declaration, get generate.ts:

aries to-ts -u ./swagger.json -o ./generate.ts

Generate request function and typescript declaration, get request.ts and request.types.ts

aries to-ts -u ./swagger.json -o ./request.ts

Generate markdown doc, get doc.md:

aries to-ts -u ./swagger.json -o ./doc.md

Start a mock server :

aries mock-server -u ./swagger.json

Command options

Commands:
  to-ts [options]    Convert swagger to typescript declaration
  to-request [options]   Convert swagger to request function, generate <output> file and <output>.types file
  to-md [options]    Convert swagger to markdown docs
  to-mock [options]  Convert swagger to mock json
  mock-server [options]  Start a local server to return the mock interface

to-ts

Options:
  -u, --url <url>       Swagger link to generate, support relative path or remote url
  -o --output <output>  Specify output file path (default: "./swagger.types.ts")
  -p --pattern <pattern...>  Pattern to be matched for request path, support glob rule
  --no-autoRequired     Do not generate the property as required automatically when there is no required array in definitions

to-request

Options:
  -u, --url <url>       Swagger link to generate, support relative path or remote url
  -o --output <output>  Specify output file path (default: "./swagger.request.ts")
  -p --pattern <pattern...>  Pattern to be matched for request path, support glob rule
  --no-autoRequired     Do not generate the property as required automatically when there is no required array in definitions

to-md

Options:
  -u, --url <url>       Swagger link to generate, support relative path or remote url
  -o --output <output>  Specify output file path (default: "./swagger.docs.md")
  -p --pattern <pattern...>  Pattern to be matched for request path, support glob rule
  --no-autoMock         Do not generate the mock samples automatically when there is no example in schema

to-mock

Options:
  -u, --url <url>       Swagger link to generate, support relative path or remote url
  -o --output <output>  Specify output file path (default: "./swagger.mock.json")
  -p --pattern <pattern...>  Pattern to be matched for request path, support glob rule
  --no-autoMock         Do not generate the mock response automatically when there is no example in schema

mock-server

Options:
  -u, --url <url>       Swagger link, support relative path or remote url
  -p, --port <port>     Mock server port (default: 3000)
  -p --pattern <pattern...>  Pattern to be matched for request path, support glob rule
  --no-autoMock         Do not generate the mock response automatically when there is no example in schema

.ariesrc

Add .ariesrc.ts or .ariesrc.js in your project root directory. Support all options in command. And the command line has a higher priority than .ariesrc

| Property | Type | Required | Default | Description | | ----- | ----- | ----- | ----- | ----- | | url | string | Y | - | swagger url, support relative path and remote url | | output | string | Y | - | output file path | | pattern | string[] | N | ['/**/*'] | Glob rule to be matched for request path | | autoMock | boolean | N | true | we use example to generate mock data by default, using autoMock to determine whether mock automatically when there is no example in schema when using to-md/to-mock/mock-server | | formatMock | function | N | - | format the mock response or samples when using to-md/to-mock/mock-server, the parameter is origin mock data generated by example or autoMock | | autoRequired | boolean | N | true | determine whether the property is required by default when there is no required property in schema when using to-ts/to-request | | port | number | N | 3000 | change the mock server port when using mock-server |

.ariesrc samples

// .ariesrc.ts
import { defineConfig } from '@tooltik/aries'

export default defineConfig({
  url: './swagger.json',
  autoMock: true,
  autoRequired: true,
})

Api reference

Support usage in esm or cjs, and arguments are same with .ariesrc export:

import { toTs, toRequest, toMd, mockServer } from '@tooltik/aries'

toTs({
    url: './test/swagger.json',
    output: './test/output.node.swagger.types.ts',
    autoRequired: true,
})

toRequest({
    url: './test/swagger.json',
    output: './test/output.node.swagger.types.ts',
    autoRequired: true,
})
    
toMd({
    url: './test/swagger.json',
    output: './test/output.node.swagger.docs.md',
    pattern: '/user/**/*',
    autoMock: true,
    formatMock: (data) => {
      return {
          code: 0,
          msg: 'success',
          data,
      }
    },
})

mockServer({
  url: './test/swagger.json',
  port: 3000,
  autoMock: true,
  formatMock: (data) => {
    return {
        code: 0,
        msg: 'success',
        data,
    }
  },
})

Dev

Install

pnpm install

Link package after build

pnpm build & pnpm link --global

Run dev watch

pnpm dev

Make changes and run test

pnpm test

Uninstall

pnpm rm --global @tooltik/aries

LICENSE

MIT