sanketbajoria / ssh2-promise

ssh with promise/async await and typescript support
https://www.npmjs.com/package/ssh2-promise
MIT License
148 stars 24 forks source link

Convert exports to es6 format #25

Closed niyarlatotep closed 5 years ago

niyarlatotep commented 5 years ago

When I try to import modules as es6 modules like this: import * as SSH2Promise from 'SSH2Promise'; I got error 'This module can only be referenced with ECMAScript imports/exports by turning on the esModuleInterop' flag and referencing its default export'. Although the described in README method import SSH2Promise = require('ssh2-promise'); works well it would be nice to make exports in es6 style: export {SSH2Promise} unfortunately it probably will break require import in using code.

sanketbajoria commented 5 years ago

@Niyarlatotep Yes, good idea, Please feel free to open a PR for this.

cinderblock commented 5 years ago

Why change the API and break existing code?

@Niyarlatotep You should be able to just use esModuleInterop TypeScript option, which is suggested, by TypeScript, to be turned on.

niyarlatotep commented 5 years ago

@cinderblock Yes, thank you!