New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

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

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

A typescript definition of IPTCs public NinJS 2.0 library.

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-83.33%
Maintainers
0
Weekly downloads
 
Created
Source

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 messageRelease type
fix(logging): TICKET-1234 - Additional loggingPatch Release
feat(publish-endpoint): TICKET-2345 - Addition of the /publish endpoint to the APIMinor Feature Release
perf(event-model): TICKET-3456 - Event model update

BREAKING CHANGE: The time attribute has been removed.
Major Breaking Release

FAQs

Package last updated on 29 Jul 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc