UNPKG

3.46 kBMarkdownView Raw
1![Banner][icon-banner]
2
3[![MIT Licensed][icon-license]][link-license]
4[![NPM Version][icon-npm]][link-npm]
5[![Build Status][icon-ci]][link-ci]
6[![Dependabot Status][icon-dependabot]][link-dependabot]
7
8[![Code Issues][icon-issues]][link-issues]
9[![Codebase Maintainability][icon-maintainability]][link-maintainability]
10[![Test Coverage][icon-coverage]][link-coverage]
11[![Jest][icon-jest]][link-jest]
12
13[![Commitizen][icon-commitizen]][link-commitizen]
14[![Semantic Release][icon-semantic-release]][link-semantic-release]
15[![Prettier][icon-prettier]][link-prettier]
16
17A TypeScript loader for Cosmiconfig
18
19## Installation
20
21```bash
22yarn add @endemolshinegroup/cosmiconfig-typescript-loader
23```
24
25## Usage
26
27```typescript
28import cosmiconfig from 'cosmiconfig';
29import TypeScriptLoader from '@endemolshinegroup/cosmiconfig-typescript-loader';
30
31const moduleName = 'myModuleName';
32const explorer = cosmiconfig(moduleName, {
33 searchPlaces: [
34 'package.json',
35 `.${moduleName}rc`,
36 `.${moduleName}rc.json`,
37 `.${moduleName}rc.yaml`,
38 `.${moduleName}rc.yml`,
39 `.${moduleName}rc.ts`,
40 `.${moduleName}rc.js`,
41 `${moduleName}.config.ts`,
42 `${moduleName}.config.js`,
43 ],
44 loaders: {
45 '.ts': TypeScriptLoader,
46 },
47});
48```
49
50[icon-banner]: docs/assets/banner.png
51
52[icon-license]: https://img.shields.io/github/license/EndemolShineGroup/cosmiconfig-typescript-loader.svg?longCache=true&style=flat-square
53[link-license]: LICENSE
54[icon-npm]: https://img.shields.io/npm/v/@endemolshinegroup/cosmiconfig-typescript-loader.svg?longCache=true&style=flat-square
55[link-npm]: https://www.npmjs.com/package/@endemolshinegroup/cosmiconfig-typescript-loader
56[icon-ci]: https://img.shields.io/travis/com/EndemolShineGroup/cosmiconfig-typescript-loader.svg?longCache=true&style=flat-square
57[link-ci]: https://travis-ci.com/EndemolShineGroup/cosmiconfig-typescript-loader
58[icon-dependabot]: https://flat.badgen.net/dependabot/EndemolShineGroup/cosmiconfig-typescript-loader?icon=dependabot
59[link-dependabot]: https://dependabot.com/
60
61[icon-issues]: https://img.shields.io/codeclimate/issues/EndemolShineGroup/cosmiconfig-typescript-loader.svg?longCache=true&style=flat-square
62[link-issues]: https://codeclimate.com/github/EndemolShineGroup/cosmiconfig-typescript-loader/issues
63[icon-maintainability]: https://img.shields.io/codeclimate/maintainability/EndemolShineGroup/cosmiconfig-typescript-loader.svg?longCache=true&style=flat-square
64[link-maintainability]: https://codeclimate.com/github/EndemolShineGroup/cosmiconfig-typescript-loader
65[icon-coverage]: https://img.shields.io/codecov/c/github/EndemolShineGroup/cosmiconfig-typescript-loader/develop.svg?longCache=true&style=flat-square
66[link-coverage]: https://codecov.io/gh/EndemolShineGroup/cosmiconfig-typescript-loader
67
68[icon-jest]: https://img.shields.io/badge/tested_with-jest-99424f.svg?longCache=true&style=flat-square
69[link-jest]: https://jestjs.io/
70
71[icon-commitizen]: https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?longCache=true&style=flat-square
72[link-commitizen]: http://commitizen.github.io/cz-cli/
73[icon-semantic-release]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?longCache=true&style=flat-square
74[link-semantic-release]: https://semantic-release.gitbooks.io/semantic-release/
75[icon-prettier]: https://img.shields.io/badge/code_style-prettier-ff69b4.svg?longCache=true&style=flat-square
76[link-prettier]: https://prettier.io/