@squelette/core
TypeScript icon, indicating that this package has built-in type declarations

1.1.13 • Public • Published

@squelette/core npm version

Provides Open API parser and basic types.

Breaking Changes ⚠️

Since v1.0.0, parse method behaves differently from the previous versions.

type parsedContent = ReturnType<typeof parse>

// parsedContent === { [tag: string]: IOperation[] } <- before v1.0.0
// parsedContent === IOperation[]                    <- after v1.0.0

Limitations

  • Currently, this package only accepts Open API 3.0 written in yaml.

Install

$ yarn add @squelette/core

How to use programmatically

import fs from "fs"
import YAML from "js-yaml"
import { parse } from '@squelette/core'

const file = fs.readFileSync(YOUR_FILE_PATH, 'utf-8')
const yaml = YAML.safeLoad(file)

// retrive abstract syntax tree
const parsedAST = parse(yaml)

License

MIT

Package Sidebar

Install

npm i @squelette/core

Weekly Downloads

2

Version

1.1.13

License

MIT

Unpacked Size

33.3 kB

Total Files

26

Last publish

Collaborators

  • andoshin11