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

mbjs-data-models

v2.0.18

Published

Motion Bank data models (JavaScript)

Downloads

57

Readme

MB.js Data Models

Motion Bank data models (JavaScript)

NPM version Coverage Status CircleCI Docker Pulls

Install

First you :floppy_disk: install...

npm i --save mbjs-data-models

... then you include :fire: ...

const models = require('mbjs-data-models')

... then you get the :neckbeard:.

Documentation

What you might want to know about the Data Models... is most likely not yet here.

Annotation

Aims to conform to the Web Annotation Model.

Spoiler alert: It doesn't yet do that at all. But maybe one sweet, velvet morning...

  • The generated document UUID is a random version 4
const
  { Annotation } = models,
  anno = new Annotation({
    // see below for schema ...
  })

Schema

Here is a random example using all currently available properties.

const anno = new Annotation({
  // coming soon ...
})

Document

Used to store :file_folder: metadata about binary resources (e.g. audio, video, textfiles, etc.).

  • The generated document UUID is a version 5 and uses the property doc.file.hash as a basis for this. Exact duplicates should not be imported, if the DB checks for existing UUIDs.
const
  { Document } = models,
  doc = new Document({
    // see below for schema ...
  })

Schema

Here is a random example using all currently available properties.

const doc = new Document({
  uuid: 'a27693d7-020b-5dec-851d-a9c7c6f30ef8',
  author: 'Ryan Castro',
  source: {
    id: 'http://ahi.sn/laokdug',
    type: 'Video'
  },
  file: {
    added: '2018-04-17T01:12:05.190+02:00',
    created: '2018-04-17T01:12:05.191+02:00',
    updated: '2018-04-17T01:12:05.191+02:00',
    bytes: 3065500099,
    hash: 'b9ca06bdb57d0ad3d3a099c99593e1e20b8fbd98',
    mime: 'video/mp4',
    ext: 'mp4'
  },
  media: {
    streams: [
      {
        codec: {
          name: 'zewubu',
          longName: 'Rekun ded gizapev gejtulcu.',
          tag: '318332bff33d90e51863467d2e474f09c329e391',
          tagString: 'ajunasik',
          timeBase: '1/2000',
          type: 'video',
          profile: 'main'
        },
        dimensions: {
          width: 1280,
          height: 720,
          codedWidth: 1280,
          codedHeight: 720,
          displayAspectRatio: '16:9',
          sampleAspectRatio: '16:9',
          pixelFormat: 'yuv422'
        },
        duration: 476,
        durationTs: 576585,
        maxBitRate: 1000,
        nbFrames: 4000,
        type: 'video',
        level: 10,
        timeBase: '1/50',
        avgFrameRate: 25,
        rFrameRate: '1/1000',
        startTime: 0
      }
    ],
    format: {
      tags: [
        {
          title: 'gaszeuco',
          value: 'Kigvis maiwu ripde ad koh.'
        },
        {
          title: 'jectuote',
          value: 'Vitu wehzucih udbu oha pugetoni.'
        }
      ],
      bitRate: 1000,
      duration: 476,
      name: 'mov',
      longName: 'QuickTime',
      nbStreams: 1,
      nbPrograms: 0,
      size: 6478596780,
      startTime: 0
    }
  },
  added: '2018-04-17T01:12:05.196+02:00',
  created: '2018-04-17T01:12:05.196+02:00',
  updated: '2018-04-17T01:20:50.234+02:00'
})

Tag

Just a simple tag.

const
  { Tag } = models,
  tag = new Tag({
    // see below for schema ...
  })

Schema

Here is a random example using all currently available properties.

const tag = new Tag({
  title: 'itsatag',
  value: 'and here is some more optional content to it'
})

Convenience

serializeJSON

Serializes the current instance as JSON text data :memo: (with optional :sparkles: pretty printing).

const
  anno = new Annotation(),
  // compact JSON
  compact = anno.serializeJSON(),
  // pretty JSON
  pretty = anno.serializeJSON({ pretty: true })

fromJSON

Resurrects a prior :skull: instance from stored JSON text data.

const
  textdata = await fs.readFileAsync('/data/annotation.json'),
  anno = Annotation.fromJSON(textdata)

Develop

Don't forget to always npm run lint and npm test before you :bomb: a commit.

Stability

experimental

This module is still under active development and subject to non-backwards compatible changes, or even removal of features, in any future version.

License

:copyright: 2020 Mainz University of Applied Sciences (Motion Bank Project) – Released under the MIT license