# @umm/scripts

> Scripts for umm

Latest version **1.0.0** (published 2018-04-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install @umm/scripts
pnpm add @umm/scripts
yarn add @umm/scripts
bun add @umm/scripts
```

Provides the commands `umm-init`, `umm-install`, `umm-uninstall`.

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-04-18 |
| First published | 2018-04-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 22.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Tetsuya Mori |
| Maintainers | fakestarbaby, hanage, kidsstar_system, mkaya, monry, risacankidsstar, takyama |

## Links

- npm: https://www.npmjs.com/package/@umm/scripts
- Repository: https://github.com/umm-projects/scripts
- Homepage: https://github.com/umm-projects/scripts#readme
- Issues: https://github.com/umm-projects/scripts/issues
- npm.io page: https://npm.io/package/@umm/scripts

## Dependencies (3)

- [glob](https://npm.io/package/glob.md) ^7.1.2
- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1
- [rimraf](https://npm.io/package/rimraf.md) ^2.6.2

## Recent versions

- 1.0.0 (latest) — 2018-04-18

## README

[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)
[![CircleCI](https://circleci.com/gh/umm-projects/scripts/tree/master.svg?style=svg)](https://circleci.com/gh/umm-projects/scripts/tree/master)

# scripts

Scripts for umm modules.

## Script list

* init
* install
* uninstall

## Library list

* info
* synchronize

## Usage

### package.json

#### Normal

```json
{

  "scripts": {
    "umm:init": "./node_modules/.bin/umm-init",
    "umm:install": "./node_modules/.bin/umm-install",
    "umm:uninstall": "./node_modules/.bin/umm-uninstall",
    "postinstall": "npm run --silent umm:install",
    "postuninstall": "npm run --silent umm:uninstall"
  },

}
```

* Automatic deployment by `umm:install`.
* Copy assets to `Assets/Modules/<scope>@<module>/` from `Assets/` in modules excepts listed in `.npmignore`.

#### Customized

```json
{

  "scripts": {
    "umm:init": "./node_modules/.bin/umm-init",
    "umm:install": "./node_modules/.bin/umm-install",
    "umm:uninstall": "./node_modules/.bin/umm-uninstall",
    "postinstall": "npm run --silent umm:install && node ./scripts/postinstall.js",
    "postuninstall": "npm run --silent umm:uninstall"
  },

}
```

* Append calling script into `postinstall` section if you need to customized deploy.

### postinstall.js

```javascript
const umm = require('@umm/scripts');

umm.libraries.synchronize("path/to/source", "path/to/destination");
```

*

## Signature

### `libraries.synchronize(source_path, destination_path, [patterns], [overwrite_options], [callback])`

* Synchronize assets flexiblly.

#### Detail

| Argument | Type | Description |
| --- | --- | --- |
| source_path | `{String}` | Copy source path |
| destination_path | `{String}` | Copy destination path |
| patterns | `{Array<String|Object>}` | Specification patterns as array of string or object |
| overwrite_options | `{Object}` | Overwrite default options |
| callback | `{Function}` | Callback function |

#### Details of patterns

#### Detail

| Key | Type | Description | Default |
| --- | --- | --- | --- |
| pattern | `{String}` | Designation patterns as glob. | - |
| overwrite | `{Boolean}` | Overwrite files if already exists. | true |
| remove_source | `{Boolean}` | Remove source files when finish copy. | false |
| remove_empty_source_directory | `{Boolean}` | Remove empty directory in source path after finish processing `remove_source`. | false |
| remove_deleted_files | `{Boolean}` | Remove files that do not exist on the source path. | false |

#### Details of overwrite_options

* Parameters are ignored if specified by patterns.

#### Detail

| Key | Type | Description | Default |
| --- | --- | --- | --- |
| overwrite | `{Boolean}` | Overwrite files if already exists. | true |
| remove_source | `{Boolean}` | Remove source files when finish copy. | false |
| remove_empty_source_directory | `{Boolean}` | Remove empty directory in source path after finish processing `remove_source`. | false |
| remove_deleted_files | `{Boolean}` | Remove files that do not exist on the source path. | false |

### `libraries.info`

* Information of module as JavaScript `Object`.

#### Detail

| Key | Type | Description |
| --- | --- | --- |
| npm_package_name | `{String}` | Name of npm package. |
| has_scope | `{Boolean}` | Package name has scope? (Package name has `@` character if scoped.) |
| development_install | `{Boolean}` | Set `true` if installation process is development. |
| module_name | `{String}` | Module name. |
| scope | `{String}` | Scope of module. |
| name | `{String}` | Name of module. |
| package_path | `{String}` | Path to package install. |
| base_path | `{String}` | Path of project. |

#### Example

```javascript
{
  npm_package_name: "@umm/sample_module",
  has_scope: true,
  development_install: false,
  module_name: "umm@sample_module",
  scope: "umm",
  name: "sample_module",
  package_path: "/Users/monry/Development/git/monry/some_project/node_modules/@umm/sample_module",
  base_path: "/Users/monry/Development/git/monry/some_project",
}
```

# License

Copyright (c) 2018 Tetsuya Mori

Released under the MIT license, see [LICENSE.txt](LICENSE.txt)

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