DEV Community

Indigo Norrbottenspets
Indigo Norrbottenspets

Posted on

ES6: Imports import

import 'helpers'
//aka: require('···')
Enter fullscreen mode Exit fullscreen mode

import Express from 'express'
//aka: const Express = require('···').default || require('···')
Enter fullscreen mode Exit fullscreen mode

import { indent } from 'helpers'
//aka: const indent = require('···').indent
Enter fullscreen mode Exit fullscreen mode

import *as Helpers from 'helpers'
//aka: const Helpers = require('···')
Enter fullscreen mode Exit fullscreen mode

import { indentSpaces as indent } from 'helpers'
//aka: const indent = require('···').indentSpaces
Enter fullscreen mode Exit fullscreen mode

import is the new require().
See: Module imports

Useful links

Top comments (0)

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay