{"id":15821052,"url":"https://github.com/anilsenay/jslice","last_synced_at":"2026-05-20T14:05:03.303Z","repository":{"id":110291629,"uuid":"584863002","full_name":"anilsenay/jslice","owner":"anilsenay","description":"JSlice is a Golang package that provides a set of methods to manipulate arrays which are built-in functions in JavaScript.","archived":false,"fork":false,"pushed_at":"2023-01-03T20:48:55.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-12T07:39:26.990Z","etag":null,"topics":["array","function","go","golang","javascript","operations","slice"],"latest_commit_sha":null,"homepage":"","language":"Go","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/anilsenay.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":"2023-01-03T17:55:31.000Z","updated_at":"2023-01-03T20:50:45.000Z","dependencies_parsed_at":"2023-03-21T14:17:46.782Z","dependency_job_id":null,"html_url":"https://github.com/anilsenay/jslice","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/anilsenay/jslice","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anilsenay%2Fjslice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anilsenay%2Fjslice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anilsenay%2Fjslice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anilsenay%2Fjslice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anilsenay","download_url":"https://codeload.github.com/anilsenay/jslice/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anilsenay%2Fjslice/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266263057,"owners_count":23901356,"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":["array","function","go","golang","javascript","operations","slice"],"created_at":"2024-10-05T07:20:19.486Z","updated_at":"2026-05-20T14:05:03.268Z","avatar_url":"https://github.com/anilsenay.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSlice\n\n\u003cimg src=\"https://i.ibb.co/PjyZ8zL/Frame-2-removebg-preview.png\" alt=\"Swagno\" align=\"right\" width=\"300\"/\u003e\n\nJSlice is a Golang package that provides a set of methods to manipulate arrays which are [built-in functions in JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array).\n\n## About the Project\n\nI implemented this package as hobby project. I personally do not use external package for array manipulation. I prefer to implement them with for loop etc. when necessary. But if you are looking for a package that provides array manipulation methods, this package may help you.\n\n## Getting started\n\n1. Get jslice package in your project\n\n```sh\ngo get github.com/anilsenay/jslice\n```\n\n2. Import jslice\n\n```go\nimport \"github.com/anilsenay/jslice\"\n```\n\n3. Use jslice methods\n\n```go\nslice := jslice.Of(1, 2, 3, 4, 5)\nfilteredSlice = slice.Filter(func(i int) bool {return i \u003e 3}) // [4,5]\nfilteredSlice = filteredSlice.Take(1) // [4]\n```\n\nChaning methods is also possible.\n\n```go\nintSlice := []int{1, 2, 3, 4, 5}\nslice = jslice.From(intSlice).Filter(func(i int) bool {\n  return i \u003e 3\n}).Map(func(i int) int {\n  return i * 2\n})\n\nfmt.Println(slice) // [8,10]\n```\n\n## Methods\n\n| Function         | JavaScript | JSlice |\n| ---------------- | ---------- | ------ |\n| at()             | ✅         | ✅     |\n| concat()         | ✅         | ✅     |\n| copyWithin()     | ✅         | ❌     |\n| entries()        | ✅         | ❌     |\n| every()          | ✅         | ✅     |\n| fill()           | ✅         | ❌     |\n| filter()         | ✅         | ✅     |\n| find()           | ✅         | ✅     |\n| findIndex()      | ✅         | ✅     |\n| findLast()       | ✅         | ✅     |\n| findLastIndex()  | ✅         | ✅     |\n| flat()           | ✅         | ❌     |\n| flatMap()        | ✅         | ❌     |\n| forEach()        | ✅         | ✅     |\n| group()          | ✅         | ❌     |\n| groupToMap()     | ✅         | ❌     |\n| includes()       | ✅         | ✅     |\n| indexOf()        | ✅         | ✅     |\n| join()           | ✅         | ✅     |\n| keys()           | ✅         | ✅     |\n| lastIndexOf()    | ✅         | ✅     |\n| map()            | ✅         | ✅     |\n| pop()            | ✅         | ✅     |\n| push()           | ✅         | ✅     |\n| reduce()         | ✅         | ❌     |\n| reduceRight()    | ✅         | ❌     |\n| reverse()        | ✅         | ✅     |\n| shift()          | ✅         | ✅     |\n| slice()          | ✅         | ✅     |\n| some()           | ✅         | ✅     |\n| sort()           | ✅         | ✅     |\n| splice()         | ✅         | ❌     |\n| toLocaleString() | ✅         | ❌     |\n| toString()       | ✅         | ✅     |\n| unshift()        | ✅         | ✅     |\n| values()         | ✅         | ✅     |\n\n# Contribution\n\nI am welcome to any contribution. Missing methods can be implemented. And also, you can improve the existing methods. Please feel free to open an issue or pull request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanilsenay%2Fjslice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanilsenay%2Fjslice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanilsenay%2Fjslice/lists"}