From 724d47fb6a2a4e37863f00b291a6832a3bffd4ec Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Mon, 27 Mar 2017 09:58:55 -0400 Subject: [PATCH] doc(image-stream): document that .getFromFilePath also resolves metadata (#1217) See: https://github.com/resin-io/etcher/pull/1211#issuecomment-288896853 Signed-off-by: Juan Cruz Viotti --- lib/image-stream/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/image-stream/index.js b/lib/image-stream/index.js index a71c1b2c..96376737 100644 --- a/lib/image-stream/index.js +++ b/lib/image-stream/index.js @@ -31,7 +31,8 @@ const errors = require('../shared/errors'); * @public * * @description - * This function resolves an object containing the following properties: + * This function resolves an object containing the following properties, + * along with various extra metadata: * * - `Number size`: The input file size. * @@ -55,6 +56,11 @@ const errors = require('../shared/errors'); * const imageStream = require('./lib/image-stream'); * * imageStream.getFromFilePath('path/to/rpi.img.xz').then((image) => { + * console.log(`The image display name is: ${image.name}`); + * console.log(`The image url is: ${image.url}`); + * console.log(`The image support url is: ${image.supportUrl}`); + * console.log(`The image logo is: ${image.logo}`); + * * image.stream * .pipe(image.transform) * .pipe(fs.createWriteStream('/dev/disk2'));