This TypeScript guide assumes you have basic knowledge of TypeScript and its ecosystem. To get the most out of `@push.rocks/smartpnpm`, ensure your environment is set up for TypeScript execution.
### Getting Started
First, import `SmartPnpm` from `@push.rocks/smartpnpm` in your TypeScript file:
```typescript
import { SmartPnpm } from '@push.rocks/smartpnpm';
```
Instantiate `SmartPnpm` with the directory path of the project you want to manage with pnpm. This is typically the root directory of your project:
```typescript
const smartPnpm = new SmartPnpm('/path/to/your/project');
```
### Retrieving Dependency License Information
One of the core features of `@push.rocks/smartpnpm` is the ability to retrieve license information for all dependencies within a project. This can be especially useful for license compliance and audit purposes.
#### Get Dependency License JSON
To get an overview of the licenses used by your project's dependencies in JSON format, use the `getDependencyLicenseJson` method:
This method provides a simple list of all unique license types found in your project's dependencies.
### Advanced Use Cases
`@push.rocks/smartpnpm` offers flexibility for integrating pnpm functionality into your code. Here are advanced scenarios you might consider:
- **Automating License Checks**: Integrate `@push.rocks/smartpnpm` into your CI/CD pipeline to ensure that only compatible licenses are used in your project.
- **Custom Reporting**: Use the provided methods to generate custom reports or dashboards showcasing your project's compliance with licensing requirements.
- **Dependency Management Automation**: Beyond license checks, you can extend the functionality to automate other dependency management tasks, combining the power of `@push.rocks/smartshell` with `@push.rocks/smartpnpm`.
### Conclusion
`@push.rocks/smartpnpm` facilitates direct interaction with pnpm, enhancing your project's dependency management and compliance processes within a TypeScript environment. By leveraging its capabilities, you can better manage your project's dependencies, ensure compliance with license requirements, and automate your workflows effectively.
For specific use cases or troubleshooting, refer to the official `pnpm` documentation alongside this guide to address your project's particular needs.
## License and Legal Information
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
### Trademarks
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.