Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

credit-roles

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

credit-roles

Enumeration and normalization of CRT Contributor Roles (https://credit.niso.org/)

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.6K
increased by43.3%
Maintainers
1
Weekly downloads
 
Created
Source

credit-roles

credit-roles on npm MIT License CI

CRediT (Contributor Roles Taxonomy) is a high-level taxonomy, including 14 roles, that can be used to represent the roles typically played by contributors to research outputs. The roles describe each contributor’s specific contribution to the scholarly output. (https://credit.niso.org/)

A utility for validating CRT Contributor Roles in your application, building canonical URLS, and showing descriptions.

npm install credit-roles

The library has no dependencies, and is helpful in validating, normalizing and showing descriptions of CRediT roles.

Overview & Usage

import credit, { CreditRole, CreditDescriptions } from 'credit-roles';

// Validate that a string is a role
credit.validate('contributor'); // true

// Handles British spelling and capicalizations
credit.normalize('conceptualiSation'); // "Conceptualization"

// Handles different punctuation
credit.normalize('writing:  original draft'); // "Writing – original draft"

// Show the descriptions in your application
CreditDescriptions['Supervision']; // Oversight and leadership responsibility...

// An enum for easy access to the roles
CreditRole.WritingOriginalDraft;

Included Utilities

  • validate - Validates if a string to a CRediT role if it is valid, will take URLs and unformatted strings
  • normalize - Normalizes a CRediT string into the canonical string (including hyphens, capitalization and punctuation)
  • buildUrl - Builds a URL to https://credit.niso.org, includes normalization
  • CreditRole - an enum of the CRediT roles
  • CreditDescriptions - Official descriptions of the CRediT roles by NISO

Options

  • strict: only accept normalized CRediT roles when validating or building URLs

References


Made with love by Curvenote

Keywords

FAQs

Package last updated on 01 Jan 2023

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