-
Notifications
You must be signed in to change notification settings - Fork 2
Configuration
Raphael Kieling edited this page Oct 22, 2023
·
1 revision
There are 2 ways to create your config:
- Returning an array
- Returning a function
Check the
examples
in the root folder
// doctorenv.config.js
module.exports = [
{
title: 'NPM',
task: async ({ bash }) => {
await bash`npm --version`
},
}
]
This function is to facilitate the usage of the builder or other context parameters. Obviusly, you can return a function that returns an array:
// doctorenv.config.js
module.exports = () => [
{
title: 'NPM',
task: async ({ bash }) => {
await bash`npm --version`
},
}
]
But the recommended way would be:
// doctorenv.config.js
module.exports = ({ builder }) => {
return builder
.task('check package manager')
.subTask('has npm', ({ bash }) => bash`npm --version`)
.subTask('has yarn', ({ bash }) => bash`yarn --version`)
.build()
}