最終更新:2018-01-07 (日) 08:35:59 (2318d)
Node.js/モジュール
https://nodejs.org/api/modules.html
使い方
使う方
const circle = require('./circle.js'); console.log(`The area of a circle of radius 4 is ${circle.area(4)}`);
モジュール側
- Node.js/exports
const { PI } = Math; exports.area = (r) => PI * r ** 2; exports.circumference = (r) => 2 * PI * r;
- 複数ファイルのとき
- index.js?
ビルトイン
- Node.js/assert
- Node.js/buffer
- Node.js/addons?
- Node.js/child_process?
- Node.js/cluster?
- Node.js/cli?
- Node.js/console?
- Node.js/crypto?
- Node.js/debugger?
- Node.js/dns?
- Node.js/domain?
- Node.js/errors?
- Node.js/events?
- Node.js/fs
- Node.js/globals?
- Node.js/http
- Node.js/https
- Node.js/modules?
- Node.js/net
- Node.js/os?
- Node.js/path
- Node.js/process
- Node.js/punycode?
- Node.js/querystring
- Node.js/readline?
- Node.js/repl?
- Node.js/stream
- Node.js/string_decoder?
- Node.js/timers?
- Node.js/tls?
- Node.js/tty?
- Node.js/dgram?
- Node.js/url
- Node.js/util?
- Node.js/v8?
- Node.js/vm?
- Node.js/zlib