{"id":16721524,"url":"https://github.com/jdormit/open-read-later-js","last_synced_at":"2025-03-15T12:24:21.842Z","repository":{"id":72492257,"uuid":"98920478","full_name":"jdormit/open-read-later-js","owner":"jdormit","description":"A JavaScript implementation of the Open Read-Later specification","archived":false,"fork":false,"pushed_at":"2017-08-02T03:11:42.000Z","size":77,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-22T02:45:58.252Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jdormit.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-31T19:03:35.000Z","updated_at":"2017-08-02T03:03:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"6668b579-5766-4cad-9d93-0d013fe0df6e","html_url":"https://github.com/jdormit/open-read-later-js","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdormit%2Fopen-read-later-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdormit%2Fopen-read-later-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdormit%2Fopen-read-later-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdormit%2Fopen-read-later-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdormit","download_url":"https://codeload.github.com/jdormit/open-read-later-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243727714,"owners_count":20338073,"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-10-12T22:31:01.491Z","updated_at":"2025-03-15T12:24:21.824Z","avatar_url":"https://github.com/jdormit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# open-read-later.js\n\u003e A JavaScript implementation of the [Open Read-Later specification](https://github.com/jdormit/open-read-later)\n\nThe Open Read-Later specification defines a file format for storing read-later lists in a cross-application, user-friendly way. [Check out the specification](https://github.com/jdormit/open-read-later) to learn more. This library implements the specification, providing a straightforward API to parse Open Read-Later files, create new read-later list objects, and add, update, query, and delete links from these objects.\n\n## Installation\n`open-read-later.js` is available on npm:\n\n```\n$ npm install open-read-later\n```\n\n## API\nThe core of the library involves creating and manipulating two types of objects: `LinkEntry` objects and `ReadLaterList` objects.\n\n`LinkEntry` objects are defined as:\n\n```typescript\n{\n    url: string,\n    title: string,\n    tags?: string[]\n}\n```\n\n`ReadLaterList` objects are defined as:\n\n```typescript\n{\n    links: LinkEntry[],\n    addLink: (link: LinkEntry) =\u003e ReadLaterList,\n    getLink: (url: string) =\u003e LinkEntry,\n    updateLink: (url: string, newLink: LinkEntry) =\u003e ReadLaterList,\n    removeLink: (url: string) =\u003e ReadLaterList,\n    toString: () =\u003e string\n}\n```\n\nFor the most part, `ReadLaterList` object methods are self-explanatory. It is important to note that the `addLink`, `updateLink`, and `removeLink` methods return a new `ReadLaterList` rather than mutating the existing one. This means they can be chained:\n\n```javascript\nconst myReadLaterList = newReadLaterList()\n    .addLink({ url: 'http://example.com', title: 'Example' })\n    .addLink({ url: 'https://github.com', title: 'GitHub'})\n    .updateLink('https://github.com', { url: 'https://github.com', title: 'GitHub', tags: [ 'open source', 'code'] })\n    .removeLink('http://example.com');\n```\n\nThe `toString` method returns the `ReadLaterList` as an Open Read-Later-formatted `string`.\n\nThe `open-read-later` module exposes two functions for creating new `ReadLaterList` objects: `parseReadLaterList` and `newReadLaterList`.\n\n`parseReadLaterList` is defined as:\n\n```typescript\nparseReadLaterList: (listText: string) =\u003e ReadLaterList\n```\n\nThe `listText` is a `string` in the Open Read-Later format. `parseReadLaterList` returns a new `ReadLaterList` containing the links specified in the `listText`.\n\n`newReadLaterList` is defined as:\n\n```typescript\nnewReadLaterList: () =\u003e ReadLaterList\n```\n\n`newReadLaterList` returns an empty `ReadLaterList`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdormit%2Fopen-read-later-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdormit%2Fopen-read-later-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdormit%2Fopen-read-later-js/lists"}