Skip to content

create-readme

createReadmeFile(options, [deletedPaths]) ⇒ Promise.<void>

Creates or updates the README file for the documentation. If a custom README file is provided, its content will be used; otherwise, a default welcome message will be written.

Kind: global function
Returns: Promise.<void> - A promise that resolves when the README file has been successfully created or updated.
Throws:

  • Will throw an error if there's an issue reading from or writing to the file system.
ParamTypeDescription
optionsPluginOptionsThe plugin options providing configuration for the README creation.
[deletedPaths]Array.<string>An optional list of paths that were deleted. Used to check if the README was among them.

Example

js
const options = {
  srcFolder: './src',
  codeFolder: 'code',
  docsFolder: './docs',
  title: 'My Documentation',
  readme: './src/README.md'
};

createReadmeFile(options);
const options = {
  srcFolder: './src',
  codeFolder: 'code',
  docsFolder: './docs',
  title: 'My Documentation',
  readme: './src/README.md'
};

createReadmeFile(options);

Released under the MIT License.