{"id":26291539,"url":"https://github.com/larswaechter/listing.js","last_synced_at":"2025-05-08T01:41:48.140Z","repository":{"id":25951789,"uuid":"106324596","full_name":"larswaechter/listing.js","owner":"larswaechter","description":"A JavaScript library for working with comma separated lists.","archived":false,"fork":false,"pushed_at":"2023-03-06T14:33:27.000Z","size":538,"stargazers_count":13,"open_issues_count":2,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T05:48:40.384Z","etag":null,"topics":["hacktoberfest","hacktoberfest2021","javascript","library","nodejs"],"latest_commit_sha":null,"homepage":"https://larswaechter.github.io/listing.js/","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/larswaechter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-09T19:09:50.000Z","updated_at":"2021-11-16T11:37:42.000Z","dependencies_parsed_at":"2023-01-14T03:45:06.449Z","dependency_job_id":null,"html_url":"https://github.com/larswaechter/listing.js","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larswaechter%2Flisting.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larswaechter%2Flisting.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larswaechter%2Flisting.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larswaechter%2Flisting.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/larswaechter","download_url":"https://codeload.github.com/larswaechter/listing.js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252983761,"owners_count":21835758,"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":["hacktoberfest","hacktoberfest2021","javascript","library","nodejs"],"created_at":"2025-03-15T00:39:24.843Z","updated_at":"2025-05-08T01:41:48.118Z","avatar_url":"https://github.com/larswaechter.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# listing.js\n\nA JavaScript library for working with comma separated lists.\n\n[![NPM](https://nodei.co/npm/listing.js.png)](https://nodei.co/npm/listing.js/)\n\n![Tests](https://github.com/larswaechter/listing.js/actions/workflows/tests.yaml/badge.svg)\n![Linter](https://github.com/larswaechter/listing.js/actions/workflows/linter.yaml/badge.svg)\n\n## Introduction\n\nlisting.js is a library that simplifies the work with comma separated lists in JavaScript. Most of the features are similar to those of array methods. Besides commas, other delimiters are supported as well.\n\n## 💻 Installation\n\nInstall via npm or yarn:\n\n```\nnpm i --save listing.js\n```\n\n## 🔨 Usage\n\n```javascript\n// ES6: import Listing from 'listing.js';\nconst Listing = require('listing.js');\n\nconst list = new Listing('1,2,3,4');\nlist.prepend(0);\nlist.append(5);\n\n// 0 1 2 3 4 5\nfor (const item of list) console.log(item);\n```\n\nThe list items are accessible via the `.list` property:\n\n```javascript\nconst myList = new Listing('1,2,3');\nconsole.log(myList.list); // 1,2,3\n```\n\nYou can also use strings instead of numbers as items:\n\n```javascript\nconst list = new Listing('hello,I,am,John');\n```\n\nlisting.js supports the following delimiters. In this case, each number is a single list item:\n\n```javascript\nconst list1 = new Listing('1,2,3'); // ,\nconst list2 = new Listing('1;2;3'); // ;\nconst list3 = new Listing('1:2:3'); // :\nconst list4 = new Listing('1-2-3'); // -\nconst list5 = new Listing('1_2_3'); // _\nconst list6 = new Listing('1.2.3'); // .\nconst list7 = new Listing('1|2|3'); // |\n```\n\nThe delimiter can be changed later on:\n\n```javascript\nconst myList = new Listing('1,2,3');\nmyList.setDelimiter(':');\nconsole.log(myList.list); // 1:2:3\n```\n\n## 📚 Documentation\n\nYou can find the complete documentation including all available methods [here](https://larswaechter.github.io/listing.js/).\n\n## :octocat: Contributing\n\nSee [CONTRIBUTING.md](https://github.com/larswaechter/listing.js/blob/master/CONTRIBUTING.md)\n\n## 🔓 License\n\n[MIT](https://github.com/larswaechter/listing.js/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flarswaechter%2Flisting.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flarswaechter%2Flisting.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flarswaechter%2Flisting.js/lists"}