41
39

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ECMAScript modulesとCommonJS modulesの使い分け

Last updated at Posted at 2016-04-11

個人の感想です。

規約

  • 相対パスは ECMAScript modules で import/export
  • それ以外は Common JS で require/module.exports

意味

  • 内界 - プロジェクト内のコードはECMAScript modulesでやり取り
  • 外界 - npmパッケージを require や、package.jsonの "main" へのexportはCommonJSでやり取り

const fs = require("fs");
const path = require("path");
const mkdirp = require("mkdirp");
const Promise = require("bluebird");
const debug = require("debug")("textlint:cli");
import options from "./options";
import TextLintEngine from "./textlint-engine";
import TextFixEngine from "./textfix-engine";
import Config from "./config/config";
import configInit from "./config/config-initializer";
import TextLintFixer from "./fixer/textlint-fixer";
import Logger from "./util/logger";

その他

41
39
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
41
39

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?