0
var MCrypt = require('mcrypt').MCrypt;

How is it like to use import instead of require to do above code? I don't think it's possible to do in one line.

  • 1
    In the title you write `call a method on the fly` but in the question, you do not have a method call? – t.niese Jun 01 '18 at 12:21

1 Answers1

1
var MCrypt = require('mcrypt').MCrypt;

to

import { MCrypt } from 'mcrypt';

Use {} for access specific property

Nishant Dixit
  • 5,388
  • 5
  • 17
  • 29