mirror of
https://github.com/tenrok/axios.git
synced 2026-05-27 14:47:43 +03:00
upadating README: notes on CommonJS autocomplete (#2256)
closes #2226. add note on how to gain typings / autocomplete / intellisense when using CommonJS (`require()`) imports
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user