![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
@pa-media-group/iptc-ninjs-2-type
Advanced tools
A typescript definition of IPTCs public NinJS 2.0 library.
Typescript type definition of IPTCs NinJS V2.0 standard (https://github.com/iptc/newsinjson).
npm i @pa-media-group/iptc-ninjs-2-type
import { NinjsItem } from '@pa-media-group/iptc-ninjs-2-type';
const typed: NinjsItem = {
"uri": "https://myuri.com/test/1"
};
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);
You need node.js installed globally to run the validator and tests. We recommend you manage your Node versions with nvm.
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
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)
In order to set up git hooks for development, please run npm run prepare
after installing the dependencies
Tests are run using the jest framework and include a coverage check as default. They can be executed by running
npm run test
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 | |
perf(event-model): TICKET-3456 - Event model update BREAKING CHANGE: The time attribute has been removed. |
FAQs
A typescript definition of IPTCs public NinJS 2.0 library.
The npm package @pa-media-group/iptc-ninjs-2-type receives a total of 0 weekly downloads. As such, @pa-media-group/iptc-ninjs-2-type popularity was classified as not popular.
We found that @pa-media-group/iptc-ninjs-2-type demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.