{"id":15776061,"url":"https://github.com/rferro/interpreting","last_synced_at":"2025-04-14T19:55:08.069Z","repository":{"id":57275291,"uuid":"97547312","full_name":"rferro/interpreting","owner":"rferro","description":"Require any file extension of interpret dictionary.","archived":false,"fork":false,"pushed_at":"2017-07-26T16:21:50.000Z","size":47,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-05-08T21:00:38.304Z","etag":null,"topics":["babel","coffee","interpret","require"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/interpreting","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/rferro.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}},"created_at":"2017-07-18T03:14:26.000Z","updated_at":"2017-09-06T07:05:13.000Z","dependencies_parsed_at":"2022-09-15T19:10:33.510Z","dependency_job_id":null,"html_url":"https://github.com/rferro/interpreting","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rferro%2Finterpreting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rferro%2Finterpreting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rferro%2Finterpreting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rferro%2Finterpreting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rferro","download_url":"https://codeload.github.com/rferro/interpreting/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248952201,"owners_count":21188422,"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":["babel","coffee","interpret","require"],"created_at":"2024-10-04T17:04:43.229Z","updated_at":"2025-04-14T19:55:08.052Z","avatar_url":"https://github.com/rferro.png","language":"JavaScript","readme":"\n# interpreting\n\n\u003e Require any file extension of interpret dictionary.\n\n[![npm][npm]][npm-url]\n[![node][node]][node-url]\n[![npmd][npmd]][npmd-url]\n[![tests][tests]][tests-url]\n[![deps][deps]][deps-url]\n[![ddeps][ddeps]][ddeps-url]\n[![standard][standard]][standard-url]\n\nRequire using the dictionary of file extensions and associated module loaders from [interpret](https://github.com/js-cli/js-interpret) dictionary. Useful, for example, to allow config files in any supported file extension, like requiring webpack config file just doing `interpreting('./webpack.config')`.\n\nAvailable file extensions and the associated module loader:\n  - `.js`: *none*\n  - `.babel.js`: `babel-register`\n  - `.buble.js`: `buble`\n  - `.cirru`: `cirru-script`\n  - `.cjsx`: `node-cjsx`\n  - `.co`: `coco`\n  - `.coffee`: `coffee-script`\n  - `.coffee.md`: `coffee-script`\n  - `.csv`: `require-csv`\n  - `.eg`: `earlgrey`\n  - `.iced`: `iced-coffee-script`\n  - `.iced.md`: `iced-coffee-script`\n  - `.ini`: `require-ini`\n  - `.json`: *none*\n  - `.json5`: `json5`\n  - `.jsx`: `babel-register`\n  - `.litcoffee`: `coffee-script`\n  - `.liticed`: `iced-coffee-script`\n  - `.ls`: `livescript`\n  - `.node`: *none*\n  - `.toml`: `toml-require`\n  - `.ts`: `ts-node`\n  - `.tsx`: `ts-node`\n  - `.wisp`: `wisp`\n  - `.xml`: `require-xml`\n  - `.yaml`: `require-yaml`\n  - `.yml`: `require-yaml`\n\n## Install\n\n### npm\n\n```sh\nnpm install --save interpreting\n```\n\n### yarn\n\n```sh\nyarn add interpreting\n```\n\n## Usage\n\n```js\nconst interpreting = require('interpreting')\n// or\nimport interpreting from 'interpreting'\n```\n\n### Examples\n\n```js\n// config.babel.js\nexport const value = 1\n```\n\n```js\ninterpreting('./config')\n// { value: 1 }\n```\n\n## API\n\n### interpreting(path, [options])\n\nIf `path` or `path.*` not exists, returns `null` or throws a error if `options.required` is `true`.\n\n#### path\n\n- Type: `string` `string[]`\n\nFile or list of files to require.\n\n#### options\n\n##### required\n\n- Type: `boolean`\n- Default: `false`\n\nIf true, at least one file must be found.\n\n##### multiple\n\n- Type: `boolean`\n- Default: `false`\n\nIf `false` returns the first found file. Otherwise, returns an array with all files founded.\n\n##### join\n\n- Type: `boolean`\n- Default: `false`\n\nIf `true` and `multiple` is true, returns the `Object.assign()` result for all files.\n\n## Resources\n\n- [interpret](https://github.com/js-cli/js-interpret) - A dictionary of file extensions and associated module loaders.\n\n## Authors\n\n- Ricardo Ferro \u003cricardo.ferro@gmail.com\u003e\n\n## License\n\nMIT\n\n[npm]: https://img.shields.io/npm/v/interpreting.svg?style=flat\n[npm-url]: https://npmjs.com/package/interpreting\n\n[node]: https://img.shields.io/node/v/interpreting.svg?style=flat\n[node-url]: https://nodejs.org\n\n[npmd]: https://img.shields.io/npm/dw/interpreting.svg?style=flat\n[npmd-url]: https://www.npmjs.com/package/interpreting\n\n[deps]: https://img.shields.io/david/rferro/interpreting.svg?style=flat\n[deps-url]: https://david-dm.org/rferro/interpreting\n\n[ddeps]: https://img.shields.io/david/dev/rferro/interpreting.svg?style=flat\n[ddeps-url]: https://david-dm.org/rferro/interpreting?type=dev\n\n[tests]: https://img.shields.io/travis/rferro/interpreting.svg?style=flat\n[tests-url]: https://travis-ci.org/rferro/interpreting\n\n[standard]: https://img.shields.io/badge/code_style-standard-brightgreen.svg?style=flat\n[standard-url]: https://standardjs.com\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frferro%2Finterpreting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frferro%2Finterpreting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frferro%2Finterpreting/lists"}