0.0.1 • Published 3 years ago

harvard_references v0.0.1

Weekly downloads
2
License
MIT
Repository
-
Last release
3 years ago

About

Use this package to generate Harvard-style references for academic sources. Currently supported types include:

  • Book
  • Chapter in Edited Book
  • Conference Paper
  • Journal Article
  • Webpage
  • Website

Pending Work

This library is new, and therefore still undergoing crucial development.

Development Roadmap:

The following features are planned for implementation: 1. Generate citation strings. 2. Support additional types of academic sources:

  • Manuscript
  • Online video
  • Report
  • Newspaper/magazine article
  • Personal correspondence
  • Entire conference proceeding
  • Unpublished conference papers/poster

Use

Installing the Package

Use Node package manager (npm) to install the package into your Node application:

$ npm install -s harvard_references 

Importing in your Project's Source File(s)

In your source code, import the "namespace" via:

const hvref = require("harvard_references");

Alternatively, using ES6 syntax:

import hvref from "harvard_references"

Generating References

const myBook = {
    // object must contain all mandatory fields for 'book' reference...
    // see table below
};

const ref = hvref.generateReference(myBook);
console.log(ref);

Specifications for Book object:

Note: All fields in a group must be specified and valid for the relevant information to be made available in the generated string.

RequiredTypeGroupDescription
idYesStringUnique ID to identify the object.
typeYesStringUsed to identify the type of academic source represented by this object. Must be value: book
titleYesStringTitle of the book.
volumeYesIntegerVolume #, must be 1 if unspecified by source.
editionYesIntegerEdition #, must be 1 if unspecified by source.
nameOfPublisherYesStringName of the book publisher.
locationOfPublisherYesStringLocation (usually the city) of the book publisher.
yearPublishedYesIntegerThe year the book was published.
translatedTitleOptionalStringOriginal title of the book - if translated.
originalLanguageOptionalStringTranslatedOriginal language of the book - if translated.
translatorsOptionalArray\<String>TranslatedTranslator(s) of the book.
yearTranslatedOptionalIntegerThe year the translation was published.
authorsOptionalArray\<String>Author(s) of the book.
corporateAuthorOptionalStringThe corporate author associated with the book. Note: If "real" authors are specified in 'authors' field, this will not be used.
editorsOptionalArray\<String>Editors(s) of the book.
titleOfSeriesOptionalStringSeriesTitle of the series the book belongs to.
numberInSeriesOptionalIntegerSeriesNumber of the book, in the series that the book belongs to.
urlOnlineAccessOptionalStringOnlineURL to access this book online.
dateOnlineAccessOptionalStringOnlineDate (represented by string "YYYY-MM-DD") that the URL was last accessed.

Specifications for Book Chapter object:

Note: All fields in a group must be specified and valid for the relevant information to be made available in the generated string.

RequiredTypeGroupDescription
idYesStringUnique ID to identify the object.
typeYesStringUsed to identify the type of academic source represented by this object. Must be value: bookChapter
titleYesStringTitle of the chapter.
titleOfBookYesStringTitle of the book.
volumeYesIntegerVolume #, must be 1 if unspecified by source.
editionYesIntegerEdition #, must be 1 if unspecified by source.
nameOfPublisherYesStringName of the book publisher.
locationOfPublisherYesStringLocation (usually the city) of the book publisher.
yearPublishedYesIntegerThe year the book was published.
authorsYesArray\<String>Author(s) of the chapter.
editorsYesArray\<String>Editors(s) of the book.
translatedTitleOptionalStringOriginal title of the book - if translated.
originalLanguageOptionalStringTranslatedOriginal language of the book - if translated.
translatorsOptionalArray\<String>TranslatedTranslator(s) of the book.
yearTranslatedOptionalIntegerThe year the translation was published.
titleOfSeriesOptionalStringSeriesTitle of the series the book belongs to.
numberInSeriesOptionalIntegerSeriesNumber of the book, in the series that the book belongs to.
urlOnlineAccessOptionalStringOnlineURL to access the chapter online.
dateOnlineAccessOptionalStringOnlineDate (represented by string "YYYY-MM-DD") that the URL was last accessed.
pageRangeOptionalStringE.g. "59", or "100-112". Represents the pages within which to find this chapter in the book.

Specifications for Conference Paper object:

Note: All fields in a group must be specified and valid for the relevant information to be made available in the generated string.

RequiredTypeGroupDescription
idYesStringUnique ID to identify the object.
typeYesStringUsed to identify the type of academic source represented by this object. Must be value: confPaper
titleYesStringTitle of the conference paper.
authorsYesArray\<String>Author(s) of the conference paper.
editorsYesArray\<String>Editors(s) of the conference proceedings.
nameOfPublisherYesStringName of the publisher of the proceedings — often a university.
locationOfPublisherYesStringLocation (usually the city) of the publisher.
nameOfConferenceYesStringName of the conference.
locationOfConferenceYesStringLocation where the conference was held.
dateConferenceBeginYesStringDate (represented by string "YYYY-MM-DD") of the first day.
dateConferenceEndYesStringDate (represented by string "YYYY-MM-DD") of the last day. Must be same as 'dateConferenceBegin' for one-day conferences.
yearPublishedYesIntegerThe year the proceedings were published.
urlOnlineAccessOptionalStringOnlineURL to access the paper online.
dateOnlineAccessOptionalStringOnlineDate (represented by string "YYYY-MM-DD") that the URL was last accessed.
pageRangeOptionalStringE.g. "59", or "100-112". Represents the pages within which to find this paper in the proceedings.

Specifications for Journal Article object:

Note: All fields in a group must be specified and valid for the relevant information to be made available in the generated string.

RequiredTypeGroupDescription
idYesStringUnique ID to identify the object.
typeYesStringUsed to identify the type of academic source represented by this object. Must be value: jnlArticle
titleYesStringTitle of the journal article.
titleOfJournalYesStringTitle of the journal that the article belongs to.
authorsYesArray\<String>Author(s) of the journal article.
volumeYesIntegerVolume # of the journal within which the article was published.
issueYesIntegerIssue # of the journal within which the article was published.
yearPublishedYesIntegerThe year the journal was published.
pageRangeYesStringE.g. "59", or "100-112". Represents the pages within which to find this paper in the journal.
urlOnlineAccessOptionalStringOnlineURL to access this journal article online.
dateOnlineAccessOptionalStringOnlineDate (represented by string "YYYY-MM-DD") that the URL was last accessed.

Specifications for Webpage object:

RequiredTypeGroupDescription
idYesStringUnique ID to identify the object.
typeYesStringUsed to identify the type of academic source represented by this object. Must be value: webpage
titleYesStringTitle of the webpage.
titleOfWebsiteYesStringTitle of the website that the page belongs to.
authorsYesArray\<String>Author(s) of the webpage.
corporateAuthorOptionalStringThe corporate author associated with the webpage. Note: If "real" authors are specified in 'authors' field, this will not be used.
yearPublishedFalseIntegerThe year the webpage was published.
urlOnlineAccessYesStringThe URL.
dateOnlineAccessYesStringDate (represented by string "YYYY-MM-DD") that the URL was last accessed.

Specifications for Website object:

RequiredTypeGroupDescription
idYesStringUnique ID to identify the object.
typeYesStringUsed to identify the type of academic source represented by this object. Must be value: website
titleYesStringTitle of the website.
authorsYesArray\<String>Author(s) of the website.
corporateAuthorOptionalStringThe corporate author associated with the website. Note: If "real" authors are specified in 'authors' field, this will not be used.
yearPublishedFalseIntegerThe year the website was published.
urlOnlineAccessYesStringThe URL.
dateOnlineAccessYesStringDate (represented by string "YYYY-MM-DD") that the URL was last accessed.