Arepalli Praveenkumar
Arepalli Praveenkumar

Reputation: 1306

translate require() syntax to import syntax node js

I am using strong-soap package in application. I am facing following syntax issue while translating require() to import statement.

var soap = require('strong-soap').soap;
     to 
import soap from 'strong-soap.soap' // doesn't work also throwing syntax error
import soap from 'strong-soap';//not working as expected

Your help is appreciated

Upvotes: 2

Views: 1262

Answers (1)

Adam Azad
Adam Azad

Reputation: 11297

soap is an object of strong-soap so the following would work -- ES6 modules importing.

import { soap } from 'strong-soap';

Upvotes: 7

Related Questions