Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@citation-js/name

citation-js151.4kMIT0.4.2

Name parser

readme

Install

npm install @citation-js/name

Use

let {parse, format} = require('@citation-js/name')

parse('First Last')
// { given: 'First', family: 'Last' }

format({ given: 'First', family: 'Last' })
// 'First Last'

API

parse(String name) -> Object

  • String name: Any name

format(Object name[, Boolean reversed]) -> String

  • Object name: Any name
  • Boolean reversed: Format as Last, First instead of First Last

Here, Object (CSL-JSON author format) has the following properties:

  • given
  • family
  • suffix
  • dropping-particle
  • non-dropping-particle

changelog

0.4.1 (2018-08-26)

Slightly breaking in the sense that the platform support has been set to Node 6.

Chores

0.4.0 (2018-07-23)

Chores
Documentation Changes
Code Style Changes
  • test: handle errors building suite (150b6131)
Tests