# schematics-utilities

> 🛠️ Useful exported utilities for working with Schematics

Latest version **2.0.3** (published 2021-04-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install schematics-utilities
pnpm add schematics-utilities
yarn add schematics-utilities
bun add schematics-utilities
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.3 |
| Published | 2021-04-25 |
| First published | 2018-07-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 147.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 90 |
| Author | Nitay Neeman |
| Maintainers | nitayneeman |
| Keywords | schematic, schematics, utility, utilities, util, utils, angular, devkit, material |

## Links

- npm: https://www.npmjs.com/package/schematics-utilities
- Repository: https://github.com/nitayneeman/schematics-utilities
- Issues: https://github.com/nitayneeman/schematics-utilities/issues
- npm.io page: https://npm.io/package/schematics-utilities

## Dependencies (7)

- [rxjs](https://npm.io/package/rxjs.md) ^6.4.0
- [parse5](https://npm.io/package/parse5.md) ^5.1.0
- [typescript](https://npm.io/package/typescript.md) ^3.6.3
- [@schematics/update](https://npm.io/package/@schematics/update.md) ^0.803.8
- [@schematics/angular](https://npm.io/package/@schematics/angular.md) ^8.3.8
- [@angular-devkit/core](https://npm.io/package/@angular-devkit/core.md) ^8.3.8
- [@angular-devkit/schematics](https://npm.io/package/@angular-devkit/schematics.md) ^8.3.8

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 2.0.3 (latest) — 2021-04-25
- 2.0.0-beta.1 (beta) — 2019-10-05
- 2.0.2 — 2020-08-07
- 2.0.1 — 2020-01-04
- 2.0.0 — 2019-10-05
- 2.0.0-beta.0 — 2019-10-04
- 1.1.3 — 2019-08-02
- 1.1.2 — 2019-03-15
- 1.1.1 — 2018-09-11
- 1.1.0 — 2018-08-03
- 1.0.1 — 2018-07-19
- 1.0.0 — 2018-07-15
- 0.0.4 — 2018-07-14
- 0.0.3 — 2018-07-14
- 0.0.2 — 2018-07-14
- … 2 more at https://npm.io/package/schematics-utilities/versions

## README

<p align="center">
  <img src="https://github.com/nitayneeman/schematics-utilities/blob/master/images/logo.png?raw=true" alt="Puppeteer Logo">
</p>

<h1 align="center">Schematics Utilities</h1>

<p align="center">
  <a href="https://www.npmjs.com/package/schematics-utilities"><img src="https://img.shields.io/npm/v/schematics-utilities.svg?colorB=cb3837" alt="npm"></a>
  <a href="https://nitayneeman.github.io/schematics-utilities/"><img src="https://img.shields.io/badge/docs-typedoc-green.svg" alt="Docs"></a>
  <a href="https://www.npmjs.com/package/schematics-utilities"><img src="https://img.shields.io/npm/dt/schematics-utilities?color=blue" alt="Downloads"></a>
  <a href="https://github.com/nitayneeman/schematics-utilities/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-lightgray.svg" alt="License"></a>
</p>

<p align="center">
  <a href="https://github.com/nitayneeman/schematics-utilities#-how-to-install">Installation</a> ·
  <a href="https://github.com/nitayneeman/schematics-utilities#-how-to-use">Usage</a> ·
  <a href="https://github.com/nitayneeman/schematics-utilities#%EF%B8%8F%EF%B8%8F-disclaimer">Disclaimer</a>
</p>

## ℹ️️ Description

At the moment, none of the utilities from the Angular Schematics package are exported.

This project was created from that purpose - _providing a collection of general and useful utilities for Schematics, based on non-exported existing utilities and further_.

You might use this project as a polyfill until these utilities will be exported officially by the relevant teams (and then just replace the path you import). However, consider sticking with this project for additional and unique utilities which are planned for the future.

<br>

## 🔧 How to Install

To Install using npm, simply do:

```
npm install schematics-utilities
```

<br>

## 👨🏻‍🏫 How to Use

```javascript
import { Rule, Tree } from '@angular-devkit/schematics';
// 1. Import the needed utilities
import { addPackageJsonDependency, NodeDependency, NodeDependencyType } from 'schematics-utilities';

function addDependencies(host: Tree): Tree {
  const dependencies: NodeDependency[] = [{ type: NodeDependencyType.Default, version: '4.17.10', name: 'lodash-es' }];

  // 2. Just use it whenever you need :)
  dependencies.forEach(dependency => addPackageJsonDependency(host, dependency));

  return host;
}

export default function(): Rule {
  return (tree: Tree) => {
    addDependencies(tree);

    return tree;
  };
}
```

Check out the [API docs](https://nitayneeman.github.io/schematics-utilities/) for the available utilities.

<br>

## ⚠️️ Disclaimer

This repository contains code which is directly taken from:

- [Angular Schematics package](https://github.com/angular/angular-cli/tree/master/packages/schematics)
- [Angular Material](https://github.com/angular/components/tree/master/src/cdk/schematics/utils)

All credits go to the respective developers! 👏

<br>

## 💁🏻 Contributing

This is an open source project. Any contribution would be greatly appreciated!

---
_Source: https://npm.io/package/schematics-utilities · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
