From cbedc52758e3fb0210046e5556244217b8ebd7a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BF=BD=E5=A6=82=E5=AF=84?= Date: Tue, 25 Dec 2018 10:43:03 +0800 Subject: [PATCH] docs(readme): :memo: update code usage (#290) Fixes https://github.com/conventional-changelog/standard-version/issues/288 --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 187c93abb..ce7e55616 100644 --- a/README.md +++ b/README.md @@ -245,18 +245,18 @@ Use the `silent` option to stop `standard-version` from printing anything to the console. ```js -var standardVersion = require('standard-version') +const standardVersion = require('standard-version') // Options are the same as command line, except camelCase +// standardVersion returns a Promise standardVersion({ noVerify: true, infile: 'docs/CHANGELOG.md', silent: true -}, function (err) { - if (err) { - console.error(`standard-version failed with message: ${err.message}`) - } +}).then(() => { // standard-version is done +}).catch(err => { + console.error(`standard-version failed with message: ${err.message}`) }) ```