@oada/media-types
    TypeScript icon, indicating that this package has built-in type declarations

    2.0.0 • Public • Published

    @OADA/media-types

    This package is a library for resolving media types to their corresponding OADA schema(s).

    Installation

    yarn add @oada/media-types

    Usage

    The library takes a string, Request, or Response and returns an array of schema $ids. If it cannot determine a corresponding schema, the array will be empty.

    import mediaType2schema from '@oada/media-types';
    
    // ['https://formats.openag.io/oada/bookmarks/v1.schema.json']
    const schema = mediaType2schema('application/vnd.oada.bookmarks.1+json');
    
    // Or when dealing with http requests (e.g., in express)
    app.use((req) => {
      const schema = mediaType2schema(req);
    });

    Install

    npm i @oada/media-types

    DownloadsWeekly Downloads

    32

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    12 kB

    Total Files

    14

    Last publish

    Collaborators

    • sanoel
    • serviopalacios
    • aultac
    • awlayton
    • oadao
    • tarakawa
    • cyrusbowman
    • abalmos