Socket
Book a DemoInstallSign in
Socket

@asyncapi/problem

Package Overview
Dependencies
Maintainers
3
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@asyncapi/problem

AsyncAPI Problem interface

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
14K
-6.26%
Maintainers
3
Weekly downloads
 
Created
Source

AsyncAPI Problem

Library that implements the Problem interface. Reference https://www.rfc-editor.org/rfc/rfc7807.

Installation

npm install @asyncapi/problem
// OR
yarn add @asyncapi/problem

Examples

Simple example

import { Problem } from '@asyncapi/problem';

const problem = new Problem({ type: 'https://example.com/problem', title: 'Example problem' });
console.log(problem.get('type'));

// Output:
// https://example.com/problem

Mixin example

import { ProblemMixin } from '@asyncapi/problem';

class MyProblem extends ProblemMixin({ typePrefix: 'https://example.com' }) {}

const problem = new MyProblem({ type: 'problem', title: 'Example problem' });
console.log(problem.get('type'));

// Output:
// https://example.com/problem

Develop

  • Write code and tests in the __tests__ folder.
  • Make sure all tests pass by npm test command.
  • Make sure code can be transformed to JS by npm run build command.
  • Make sure code is well formatted and secure by npm run lint:fix command.

Contributing

Read CONTRIBUTING guide.

FAQs

Package last updated on 18 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts