JavaScript
CommonJS Module Loading

by Benny Neugebauer

const http = require('api-client').http;

const http = require('api-client/http');

the example on the left will allow more flexibility with destructuring:

const apiClient = require('api-client');

let { http, etc } = apiClient;

Aleksandr Strutynskyy

Sign in to comment!