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 🙏

© 2024 – Pkg Stats / Ryan Hefner

deckardcain

v1.0.0

Published

Identifies (media) type of API description files

Downloads

11,017

Readme

Deckard Cain

Build Status

"As a token of my gratitude, I will identify items for you at no charge."

Introduction

Deckard Cain library identifies (media) type of API description files.

Supported API description formats

  • API Blueprint - text/vnd.apiblueprint
  • Legacy Apiary Blueprint (predecessor of API Blueprint) - text/vnd.legacyblueprint
  • Swagger - application/swagger+json (according to swagger-api/swagger-spec#110) and application/swagger+yaml
  • API Description Namespace - application/vnd.refract.api-description+json and application/vnd.refract.api-description+yaml

Install

npm install deckardcain

Usage

import {identify} from 'deckardcain';

identify(`
HOST: http://example.com

--- API Name ---

All Messages
GET /messages
< 200
`) // 'text/vnd.legacyblueprint'

identify(`
FORMAT: 1A
HOST: http://example.com

# API Name

## Group Messages

### All Messages [/messages]

#### Read [GET]

+ Response 200 (text/plain)
`) // 'text/vnd.apiblueprint'

Contribute

Please mind the library is written in ECMAScript 6.

Installation

git clone https://github.com/apiaryio/deckardcain
cd deckardcain
npm install

Testing

npm test

See also the .travis.yml file.

Workflow

Source code is located in the ./src folder and gets automatically transpiled into ./lib folder when npm install or npm publish is invoked. However, should you need to transpile it manually, use npm run compile.

Name

Deckard Cain library pays tribute to a fictional character from Diablo video game series. In Diablo II, Deckard Cain provides his wisdom and identifies items for free after being rescued by the player.