{"id":29098823,"url":"https://github.com/prazdevs/cdp-recruitment-javascript","last_synced_at":"2025-06-28T15:08:20.659Z","repository":{"id":298123469,"uuid":"990698657","full_name":"prazdevs/cdp-recruitment-javascript","owner":"prazdevs","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-26T13:53:04.000Z","size":51,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-26T08:10:06.351Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/prazdevs.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,"zenodo":null}},"created_at":"2025-05-26T13:52:31.000Z","updated_at":"2025-06-04T15:48:16.000Z","dependencies_parsed_at":"2025-06-09T14:52:09.390Z","dependency_job_id":"a5a2d046-ad10-4c5e-9ed6-3a18273d71b0","html_url":"https://github.com/prazdevs/cdp-recruitment-javascript","commit_stats":null,"previous_names":["prazdevs/cdp-recruitment-javascript"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/prazdevs/cdp-recruitment-javascript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prazdevs%2Fcdp-recruitment-javascript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prazdevs%2Fcdp-recruitment-javascript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prazdevs%2Fcdp-recruitment-javascript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prazdevs%2Fcdp-recruitment-javascript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prazdevs","download_url":"https://codeload.github.com/prazdevs/cdp-recruitment-javascript/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prazdevs%2Fcdp-recruitment-javascript/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262449722,"owners_count":23312998,"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":"2025-06-28T15:08:18.484Z","updated_at":"2025-06-28T15:08:20.653Z","avatar_url":"https://github.com/prazdevs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Javascript developer test\n\n## Features\n\n- Filtering people and countries based on their animal names.\n- Programmatic use.\n- CLI.\n\n## Usage\n\nUntil published CLI must be either built and run or used through a Node-like tool running TypeScript (TSX).\n\n### Build and run\n\n```sh\npnpm install\npnpm run build\nnpx country-filter --filter=ry\n```\n\n### Run as TypeScript\n\n```sh\npnpx tsx src/cli.ts --filter=ry\n```\n\n## Options\n\n- `filter`: string to use as filter for animal names.\n- `count`: add animal count to people's name and people count to country's name.\n\n## Developer notes\n\nTesting is done through [`vitest`](https://vitest.dev) within the `test/` directory:\n\n- `.fixture.ts` files contain fixtures based on random-generated data (using `fakerjs`).\n- `.spec.ts` files contain unit tests.\n- `.bench.ts` files contain performance tests.\n\n---\n\n\u003cdetails\u003e\n\u003csummary\u003eBackground\u003c/summary\u003e\nFilter\n\nYour job is to write a command-line interface in Node.js.\nThis program has to filter a list of elements containing a pattern.\n\nDetails:\n- In the following file `data.js`, there are `Countries` containing `Peoples` containing `Animals`.\n- Only animals containing the pattern passed as argument (e.g. `ry`) are displayed. The order should be kept intact.\n- Empty array after filtering are NOT returned.\n\nSample of running the command, and its output:\n\n```shell script\n$ node app.js --filter=ry\n[\n  {\n    name: 'Uzuzozne',\n    people: [\n      {\n        name: 'Lillie Abbott',\n        animals: [\n          {\n            name: 'John Dory'\n          }\n        ]\n      }\n    ]\n  },\n  {\n    name: 'Satanwi',\n    people: [\n      {\n        name: 'Anthony Bruno',\n        animals: [\n          {\n            name: 'Oryx'\n          }\n        ]\n      }\n    ]\n  }\n]\n```\n\nCount\n\nThe next goal is to print the counts of People and Animals by counting the number of children and appending it in the name, eg. `Satanwi [2]`.\n\nSample of running the command, and its output:\n\n```shell script\nnode app.js --count\n[ { name: 'Dillauti [5]',\n    people:\n     [ { name: 'Winifred Graham [6]',\n         animals:\n          [ { name: 'Anoa' },\n            { name: 'Duck' },\n            { name: 'Narwhal' },\n            { name: 'Badger' },\n            { name: 'Cobra' },\n            { name: 'Crow' } ] },\n       { name: 'Blanche Viciani [8]',\n         animals:\n          [ { name: 'Barbet' },\n            { name: 'Rhea' },\n            { name: 'Snakes' },\n            { name: 'Antelope' },\n            { name: 'Echidna' },\n            { name: 'Crow' },\n            { name: 'Guinea Fowl' },\n            { name: 'Deer Mouse' } ] },\n      ...\n...\n]\n```\n\nRequirements\n\n- The code must be available in a GIT repository\n- No library/modules should be used, except for the testing library\n\nAppreciation\n\nWe will be really attentive to:\n\n- Code readability, structure and consistency\n- Tests, and how they are written\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprazdevs%2Fcdp-recruitment-javascript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprazdevs%2Fcdp-recruitment-javascript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprazdevs%2Fcdp-recruitment-javascript/lists"}