workspace-projects
v3.2.0
Published
A simple utility to get the workspace project list
Downloads
843
Maintainers
Readme
workspace-projects
A simple utility to get the workspace project list
Install
# use pnpm
$ pnpm install -D workspace-projects
# use yarn
$ yarn add -D workspace-projects
# use npm
$ npm install -D workspace-projects
Usage
use import
import { workspaceProjects, workspaceProjectsSync } from '@node-kit/workspace-projects'
workspaceProjects()
// or
workspaceProjectsSync()
use require
const { workspaceProjects, workspaceProjectsSync } = require('@node-kit/workspace-projects')
workspaceProjects()
// or
workspaceProjectsSync()
API reference
- Usage:
workspaceProjects(cwd)
&workspaceProjectsSync(cwd)
- Parameters:
| Param | Description | Type | Optional value | Required | Default value |
| ----- | ------------ | -------- | -------------- | -------- | ------------- |
| cwd | running path | string
| - | false
| - |
- Types:
declare function workspaceProjects(cwd?: string): Promise<string[] | null>
declare function workspaceProjectsSync(cwd?: string): string[] | null
- Demos:
- simple use
import { workspaceProjects, workspaceProjectsSync } from '@node-kit/workspace-projects'
workspaceProjects().then(data => {
console.log('The workspace projects is: ', data) // [ 'packages/utils', 'packages/monorepo-root' ]
})
console.log('The workspace projects is: ', workspaceProjectsSync()) // [ 'packages/utils', 'packages/monorepo-root' ]
Issues & Support
Please open an issue here.