nodejs stringformat パッケージをインストールし、最初の例を実行します: https://npmjs.org/package/stringformat
しかし、次のエラーが表示されます。
> npm install stringformat
> node
> var $ = require('stringformat')
> console.log($.format("Hello, {0}!", "World"))
TypeError: Object function () {
// Call as a method
return format.apply(arguments[0], Array.prototype.slice.call(arguments, 1))
} has no method 'format'
at repl:1:16
at REPLServer.self.eval (repl.js:110:21)
at Interface.<anonymous> (repl.js:239:12)
at Interface.EventEmitter.emit (events.js:95:17)
at Interface._onLine (readline.js:202:10)
at Interface._line (readline.js:531:8)
at Interface._ttyWrite (readline.js:760:14)
at ReadStream.onkeypress (readline.js:99:10)
at ReadStream.EventEmitter.emit (events.js:98:17)
at emitKey (readline.js:1095:12)
>
何が問題なのですか?