No, it’s not allowed in JS either, however there is a proposal to add it. For now, just use the two-step process with importing into a local variable and exporting that:
// file: constants.js
export const SomeConstant1 = 'yay';
export const SomeConstant2 = 'yayayaya';
// file: index.js
import * as Constants from './constants.js';
export {Constants};
Related Contents:
- What’s the meaning of “=>” (an arrow formed from equals & greater than) in JavaScript?
- One-liner to take some properties from object in ES 6
- Javascript object bracket notation ({ Navigation } =) on left side of assign
- When should I use arrow functions in ECMAScript 6?
- “Uncaught SyntaxError: Cannot use import statement outside a module” when importing ECMAScript 6
- Do let statements create properties on the global object?
- Is it possible to import modules from all files in a directory, using a wildcard?
- Where can I get info on the object parameter syntax for JavaScript functions?
- Backticks (`…`) calling a function in JavaScript
- Call async/await functions in parallel
- ES6 class variable alternatives
- Why shouldn’t JSX props use arrow functions or bind?
- using brackets with javascript import syntax
- Async function not returning value, but console.log() does: how to do? [duplicate]
- Null-safe property access (and conditional assignment) in ES6/2015
- Official information on `arguments` in ES6 Arrow functions?
- Anonymous class instance —- is it a bad idea?
- What is “export default” in JavaScript?
- Proper use of const for defining functions
- Is there a mechanism to loop x times in ES6 (ECMAScript 6) without mutable variables?
- JS/ES6: Destructuring of undefined
- Automatically set arguments as instance properties in ES6
- Merge two arrays with alternating values
- How can I access constants in the lib/constants.js file in Meteor?
- Javascript ES6 cross-browser detection
- React useState hook event handler using initial state
- “This” within es6 class method [duplicate]
- Difference between import X and import * as X in node.js (ES6 / Babel)?
- What’s the purpose of allowing duplicate property names?
- Javascript ES6 export const vs export let
- How can I mock the imports of an ES6 module?
- Template literals syntax is not working in IE11
- Why es6 react component works only with “export default”?
- comparing ECMA6 sets for equality
- Convert ES6 Iterable to Array
- What does calling super() in a React constructor do?
- Maps vs Objects in ES6, When to use?
- Spreading undefined in array vs object
- Call a child method from a parent class in ES6
- ESCMAScript 6 arrow functions – parentheses around parameter
- Javascript: What is the difference between Function and Class
- JavaScript Extending Class
- What is the difference between importing a function expression or a function declaration from a ES6 module?
- How to publish a module written in ES6 to NPM?
- How to destructure option argument with all default values in ES6?
- Alternative version for Object.values()
- Does ECMAScript 6 have a convention for abstract classes? [duplicate]
- How to get the first element of Set in ES6 ( EcmaScript 2015)
- Importing javascript file for use within vue component
- Is it possible to reset an ECMAScript 6 generator to its initial state?