diff --git a/packages/metro-bundler/react-packager/src/lib/JsonReporter.js b/packages/metro-bundler/react-packager/src/lib/JsonReporter.js new file mode 100644 index 00000000..6d47bc0c --- /dev/null +++ b/packages/metro-bundler/react-packager/src/lib/JsonReporter.js @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @flow + */ + +'use strict'; + +import {Writable} from 'stream'; + +class JsonReporter { + + _stream: Writable; + + constructor(stream: Writable) { + this._stream = stream; + } + + update(event: TEvent) { + this._stream.write(JSON.stringify(event) + '\n'); + } + +} + +module.exports = JsonReporter;