{"id":21074780,"url":"https://github.com/dawsbot/arrford","last_synced_at":"2025-05-16T06:31:33.645Z","repository":{"id":57184297,"uuid":"52077627","full_name":"dawsbot/arrford","owner":"dawsbot","description":"Array to human readable list converter","archived":false,"fork":false,"pushed_at":"2017-06-16T00:12:56.000Z","size":18,"stargazers_count":14,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-11T05:56:01.818Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dawsbot.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-19T09:41:13.000Z","updated_at":"2019-08-07T17:32:10.000Z","dependencies_parsed_at":"2022-09-14T06:20:49.086Z","dependency_job_id":null,"html_url":"https://github.com/dawsbot/arrford","commit_stats":null,"previous_names":["dawsonbotsford/arrford"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dawsbot%2Farrford","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dawsbot%2Farrford/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dawsbot%2Farrford/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dawsbot%2Farrford/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dawsbot","download_url":"https://codeload.github.com/dawsbot/arrford/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225411493,"owners_count":17470246,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T19:17:56.275Z","updated_at":"2024-11-19T19:17:57.019Z","avatar_url":"https://github.com/dawsbot.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# arrford\n[![npm version](https://img.shields.io/npm/v/arrford.svg)](https://www.npmjs.com/package/arrford)\n[![Build Status](https://travis-ci.org/dawsbot/arrford.svg?branch=master)](https://travis-ci.org/dawsbot/arrford)\n[![NPM downloads](http://img.shields.io/npm/dm/arrford.svg?style=flat)](http://npmjs.org/arrford)\n\n\u003e Array to human readable list converter\n\n\u003cbr\u003e\n\n## Install\n\n#### Node\n\n```\nnpm install --save arrford\n```\n\n#### Web\n\narrford is exported for web and usable with the variable `arrford`\n```html\n\u003cscript src=\"https://rawgit.com/dawsonbotsford/arrford/master/bundle.js\"\u003e\u003c/script\u003e\n```\n\n\u003cbr\u003e\n\n## Usage\n\n```js\n// remove require statement if using the web bundle\nconst arrford = require('arrford');\n\narrford(['run', 'climb', 'jump!']);\n//=\u003e 'run, climb, and jump!'\n```\n\n\u003cbr\u003e\n\n#### Fewer than 3 elements in array\n```js\narrford(['run', 'climb!']);\n//=\u003e 'run and climb!'\n\narrford(['run!']);\n//=\u003e 'run!'\n```\n\n\u003cbr\u003e\n\n#### Abort the Oxford comma\n```js\narrford(['run', 'climb', 'jump!'], false);\n//=\u003e 'run, climb and jump!'\n```\n\n\u003cbr\u003e\n\n#### Replace the word 'and'\n```js\narrford(['spring', 'klättra', 'hoppa!'], true, 'och');\n//=\u003e 'spring, klättra, och hoppa!'\n```\n\n\u003cbr\u003e\n\n#### Replace the word 'and' and abort the Oxford comma\n```js\narrford(['spring', 'klättra', 'hoppa!'], false, 'och');\n//=\u003e 'spring, klättra och hoppa!'\n```\n\n\u003cbr\u003e\n\n## API\n\n### arrford(target [, oxford, join])\n\n\u003cbr\u003e\n\n#### target\n\n**Type**: `Array` of `string`s\n\n\u003cbr\u003e\n\n#### oxford\n\n*optional*\n\n**Type**: `boolean`\n\n**Default**: true\n\n**Description**: whether to use the Oxford comma or not\n\n\u003cbr\u003e\n\n#### join\n\n*optional*\n\n**Type**: `string`\n\n**Default**: 'and'\n\n**Description**: word used to join the list with the last element\n\n\u003cbr\u003e\n\n#### returns\n\n**Type**: `string`\n\n**Description**: Take an array of strings and return a string of these items as a list. Insert \",\" and \"and\" in a grammatically correct way. Follow the Oxford comma trend unless `false` is passed in for the second argument. Use the word 'and' to join the list unless some other \"join\" word is specified for the third argument.\n\n\u003cbr\u003e\n\n## License\n\nMIT © [Dawson Botsford](http://dawsonbotsford.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdawsbot%2Farrford","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdawsbot%2Farrford","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdawsbot%2Farrford/lists"}