{"id":15679770,"url":"https://github.com/jonschlinkert/array-first","last_synced_at":"2025-05-07T09:33:33.111Z","repository":{"id":24511334,"uuid":"27917097","full_name":"jonschlinkert/array-first","owner":"jonschlinkert","description":"Get the first element or first n elements of an array.","archived":false,"fork":false,"pushed_at":"2021-02-13T22:13:22.000Z","size":9,"stargazers_count":11,"open_issues_count":7,"forks_count":14,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-19T20:53:50.378Z","etag":null,"topics":["array","first","javascript","nodejs"],"latest_commit_sha":null,"homepage":"https://github.com/jonschlinkert","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/jonschlinkert.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":"2014-12-12T11:06:18.000Z","updated_at":"2021-12-26T04:08:19.000Z","dependencies_parsed_at":"2022-07-23T11:02:30.869Z","dependency_job_id":null,"html_url":"https://github.com/jonschlinkert/array-first","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Farray-first","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Farray-first/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Farray-first/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Farray-first/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonschlinkert","download_url":"https://codeload.github.com/jonschlinkert/array-first/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252851458,"owners_count":21814153,"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","first","javascript","nodejs"],"created_at":"2024-10-03T16:35:55.165Z","updated_at":"2025-05-07T09:33:33.084Z","avatar_url":"https://github.com/jonschlinkert.png","language":"JavaScript","readme":"# array-first [![NPM version](https://img.shields.io/npm/v/array-first.svg)](https://www.npmjs.com/package/array-first) [![Build Status](https://img.shields.io/travis/jonschlinkert/array-first.svg)](https://travis-ci.org/jonschlinkert/array-first)\n\n\u003e Get the first element or first n elements of an array.\n\n- [Usage](#usage)\n- [Related projects](#related-projects)\n- [Running tests](#running-tests)\n- [Contributing](#contributing)\n- [Author](#author)\n- [License](#license)\n\n_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_\n\n## Usage\n\n```js\nvar first = require('array-first');\n\nfirst(['a', 'b', 'c', 'd', 'e', 'f']);\n//=\u003e 'a'\n\nfirst(['a', 'b', 'c', 'd', 'e', 'f'], 1);\n//=\u003e 'a'\n\nfirst(['a', 'b', 'c', 'd', 'e', 'f'], 3);\n//=\u003e ['a', 'b', 'c']\n```\n\n## Related projects\n\n[array-last](https://www.npmjs.com/package/array-last): Get the last or last n elements in an array. | [homepage](https://github.com/jonschlinkert/array-last)\n\n## Running tests\n\nInstall dev dependencies:\n\n```sh\n$ npm i -d \u0026\u0026 npm test\n```\n\n## Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/array-first/issues/new).\n\n## Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)\n\n## License\n\nCopyright © 2016 [Jon Schlinkert](https://github.com/jonschlinkert)\nReleased under the MIT license.\n\n***\n\n_This file was generated by [verb](https://github.com/verbose/verb) on January 12, 2016._","funding_links":[],"categories":["模块","Modules"],"sub_categories":["数组","Array"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Farray-first","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonschlinkert%2Farray-first","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Farray-first/lists"}