{"id":21158242,"url":"https://github.com/simbo/requirements-mapper","last_synced_at":"2025-03-14T15:27:00.954Z","repository":{"id":35609843,"uuid":"39883275","full_name":"simbo/requirements-mapper","owner":"simbo","description":null,"archived":false,"fork":false,"pushed_at":"2016-02-02T20:18:29.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-22T04:19:35.611Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simbo.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":"2015-07-29T08:48:29.000Z","updated_at":"2016-01-19T22:50:44.000Z","dependencies_parsed_at":"2022-09-18T00:42:01.382Z","dependency_job_id":null,"html_url":"https://github.com/simbo/requirements-mapper","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simbo%2Frequirements-mapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simbo%2Frequirements-mapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simbo%2Frequirements-mapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simbo%2Frequirements-mapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simbo","download_url":"https://codeload.github.com/simbo/requirements-mapper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243599761,"owners_count":20317152,"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-11-20T12:19:00.640Z","updated_at":"2025-03-14T15:27:00.933Z","avatar_url":"https://github.com/simbo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"requirements-mapper\n===================\n\n  \u003e Auto-require all matching files within a directory recursively and return\n  \u003e them as single object, representing the directory's structure.\n\n[![npm Package Version](https://img.shields.io/npm/v/requirements-mapper.svg?style=flat-square)](https://www.npmjs.com/package/requirements-mapper)\n[![MIT License](http://img.shields.io/:license-mit-blue.svg?style=flat-square)](http://simbo.mit-license.org)\n[![Travis Build Status](https://img.shields.io/travis/simbo/requirements-mapper/master.svg?style=flat-square)](https://travis-ci.org/simbo/requirements-mapper)\n[![Code Climate GPA](https://img.shields.io/codeclimate/github/simbo/requirements-mapper.svg?style=flat-square)](https://codeclimate.com/github/simbo/requirements-mapper)\n[![Code Climate Test Coverage](https://img.shields.io/codeclimate/coverage/github/simbo/requirements-mapper.svg?style=flat-square)](https://codeclimate.com/github/simbo/requirements-mapper)\n\n[![Dependencies Status](https://img.shields.io/david/simbo/requirements-mapper.svg?style=flat-square)](https://david-dm.org/simbo/requirements-mapper)\n[![devDependencies Status](https://img.shields.io/david/dev/simbo/requirements-mapper.svg?style=flat-square)](https://david-dm.org/simbo/requirements-mapper#info=devDependencies)\n\n---\n\n## Usage\n\n``` javascript\nvar ReqMapper = require('requirements-mapper'),\n    dataMapper = new ReqMapper('./data')),\n    dataMap = dataMapper.map();\n```\n\n\n### Example\n\nAssuming that `./data` is a directory containing multiple files using subfolders\nlike this:\n\n``` text\ndata/\n ├─╸ other/\n │    ├─╸ bar.js\n │    └─╸ baz.json\n └─╸ foo.js\n```\n\nAn object of which every node contains the `require`d contents of the respective\nfile will be returned by `RequirementsMapper.map()`:\n\n``` javascript\n{\n    other: {\n        bar: …\n        baz: …\n    },\n    foo: …\n}\n```\n\n\n### Options\n\nThe constructor of `RequirementsMapper` accepts 3 parameters:\n\n  - `dir` - directory to scan; defaults to `process.cwd()`\n  - `globPattern` - globbing pattern for finding files; defaults to\n    `**/*.js?(on)`\n  - `clearCache` - clear the require cache for a node, before requiring it; defaults to `true`\n\nSee [node-glob](https://github.com/isaacs/node-glob) for more details on \nglobbing options.\n\n\n## License\n\n[MIT Simon Lepel 2015](http://simbo.mit-license.org)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimbo%2Frequirements-mapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimbo%2Frequirements-mapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimbo%2Frequirements-mapper/lists"}