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

@pa-media-group/iptc-ninjs-2-type

v1.1.0

Published

A typescript definition of IPTCs public NinJS 2.0 library.

Downloads

12

Readme

IPTC NinJS V2.0 Type Definition

Typescript type definition of IPTCs NinJS V2.0 standard (https://github.com/iptc/newsinjson).

Installation

npm i @pa-media-group/iptc-ninjs-2-type

Usage

IPTC Ninjs 2.0 Type

import { NinjsItem } from '@pa-media-group/iptc-ninjs-2-type';

const typed: NinjsItem = {
  "uri": "https://myuri.com/test/1"
};

Validating JSON

Included is a validator which can be used to ensure JSON conforms to the IPTC Ninjs 2.0 schema it can be used as follows: -

import { NinjsItem, NinjsValidator } from 'iptc-ninjs-2-type';

const validator: NinjsValidator = new NinjsValidator();
const typed: NinjsItem = {
  "uri": "https://myuri.com/test/1"
};
const valid: boolean = validator.validate(typed);

Tech

  • typeScript - TypeScript is a typed superset of JavaScript
  • node.js - Evented I/O for the backend
  • jest - Mocking/testing framework
  • nvm - Node Version Manager

Installation

You need node.js installed globally to run the validator and tests. We recommend you manage your Node versions with nvm.

nvmrc

You need node.js installed to run the service. It is recommended that you use nvm for managing the complexity of Node versions. Using nvm, run:

nvm use

This will select the appropriate version of the Node installed on your machine upon the .nvmrc file.

Then to install the dependencies:

npm install

To install the dependencies specified by package-lock.json:

npm ci

Lint

A default typescript style lint (tslint.json) has been included in this build. To ensure that the TS files conform to the lint, run:

npm run lint

Additionally the package.json can be linted by running

npm run lint:package

Commit messages themselves are linted and Husky enforces this an example of an acceptable commit message would be

feat(initial): Define product schema confirming to Ninjs 2.0 standards

Initial commit including validator, linting, testing

[EN-1790](https://alamy.atlassian.net/browse/EN-1790)

Git hooks

In order to set up git hooks for development, please run npm run prepare after installing the dependencies

Unit Tests

Tests are run using the jest framework and include a coverage check as default. They can be executed by running

npm run test

Semantic Release - Commit style

It is recommended for clarity that the ticket reference is included in the commit message body, the format should be as follows:

fix|feat|perf(<short_feature_name>): <ticket> - <description_of_change>

Here is an example of the release type that will be done based on a commit messages.

| Commit message | Release type | | -------------------------------------------------------------------------------------------------------------------- | -------------------------- | | fix(logging): TICKET-1234 - Additional logging | Patch Release | | feat(publish-endpoint): TICKET-2345 - Addition of the /publish endpoint to the API | ~~Minor~~ Feature Release | | perf(event-model): TICKET-3456 - Event model updateBREAKING CHANGE: The time attribute has been removed. | ~~Major~~ Breaking Release |