JSPM

import-export

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1384
  • Score
    100M100P100Q122140F
  • License ISC

Use ECMA6 import/export syntax from within NodeJS (simply require this module)

Package Exports

  • import-export

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (import-export) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

##What is this?

This module lets you use ES6 modules (import/export syntax) in nodejs modules.

##How to use

In your main file require the module:

// index.js

require('import-export');

require('./some-other-file1.js');
require('./some-other-file2.js');
...

Then inside your other files you require you can use ES6 module syntax:

// some-other-file1.js

import Duck from './Duck.js';
import { Food, Pond } from 'Duck.js';

and:

// Duck.js

export default class Duck {
  ...
}

export class Pond {
  ...
}

export class Food {
  ...
}