I'm attempting to migrate a project that hooks into Azure DevOps to use ES6 module loading with Node 14.1
package.json includes field
"type": "module",
tsconfig.json includes fields
"target": "ES2020",
"module": "es2020",
"moduleResolution": "node",
Transpiled JS results in
import * as azdev from "azure-devops-node-api";
let orgUrl = process.env.API_URL;
let token = process.env.API_TOKEN;
let authHandler = azdev.getPersonalAccessTokenHandler(token);
let connection = new azdev.WebApi(orgUrl, authHandler);
Which gives the error
TypeError: azdev.getPersonalAccessTokenHandler is not a function
at file:///Users/paul/repos/azure-devops-node-api/simple/_build/index.js:4:25
at ModuleJob.run (internal/modules/esm/module_job.js:110:37)
at async Loader.import (internal/modules/esm/loader.js:179:24)
I think I may be attempting to use the function before it's imported asynchronously but can't figure out how to solve this.