Skip to content

Commit

Permalink
upadating README: notes on CommonJS autocomplete (axios#2256)
Browse files Browse the repository at this point in the history
closes axios#2226. add note on how to gain typings / autocomplete / intellisense when using CommonJS (`require()`) imports
  • Loading branch information
the-vampiire authored and genie-youn committed Sep 27, 2019
1 parent e9884cf commit c72ce66
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Expand Up @@ -57,6 +57,15 @@ Using cdn:

## Example

### note: CommonJS usage
In order to gain the TypeScript typings (for intellisense / autocomplete) while using CommonJS imports with `require()` use the following approach:

```js
const axios = require('axios').default;

// axios.<method> will now provide autocomplete and parameter typings
```

Performing a `GET` request

```js
Expand Down

0 comments on commit c72ce66

Please sign in to comment.