# mcshading

> shade datapack namespaces/folders into others

Latest version **1.0.7** (published 2021-03-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install mcshading
pnpm add mcshading
yarn add mcshading
bun add mcshading
```

Provides the command `mcshading`.

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2021-03-03 |
| First published | 2021-03-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 15.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | radiiish |
| Maintainers | radiish |

## Links

- npm: https://www.npmjs.com/package/mcshading
- npm.io page: https://npm.io/package/mcshading

## Dependencies (1)

- [chalk](https://npm.io/package/chalk.md) ^4.1.0

## Recent versions

- 1.0.7 (latest) — 2021-03-03
- 1.0.6 — 2021-03-03
- 1.0.5 — 2021-03-03
- 1.0.3 — 2021-03-03
- 1.0.2 — 2021-03-03
- 1.0.1 — 2021-03-01
- 1.0.0 — 2021-03-01

## README

# mcshading
## maven shading for datapacks and resource packs.
syncronously rewrites all references to one namespace to references to another in the contents of files and in their paths.  
  
mcshading is pretty versitile, it can be run from the command line or from a javascript/typescript program and it can be used for more than just shading.
# what mcshading does
here are some examples of how mcshading might change a datapack
```mcfunction
# command: mcshading ./old ./new
# path:    ./old/functions/tick.mcfunction

advancement grant @a only old:very_old_advancement
kill @e[type=#old:very_old_type]

# path:    ./new/functions/tick.mcfunction

advancement grant @a only new:very_old_advancement
kill @e[type=#new:very_old_type]
```
```mcfunction
# command: mcshading ./old ./new sub
# path:    ./old/functions/tick.mcfunction

advancement grant @a only old:very_old_advancement
kill @e[type=#old:very_old_type]

# path:    ./new/functions/sub/tick.mcfunction

advancement grant @a only new:sub/very_old_advancement
kill @e[type=#new:sub/very_old_type]
```
# mcshading from the command line
install the module like this to use it in a global context
```
npm i -g mcshading
```
and then to use it as such
```
mcshading <source namespace> <destination namespace>
```
example: 
```
mcshading datapack/data/foo other_datapack/data/bar bar_sub_folder/ foo_sub_folder/
```
(trailing slash is required!)
# mcshading from javascript
install the module globally (recommended) or locally (no `-g` for locally)
```
npm i -g mcshading
```
and then use the module in one of two ways
```js
const { shadeDatapack } = require('mcshading');
shadeDatapack('source', 'destination', 'more of the destination', 'more of the source');

// or

const mcshading = require('mcshading');
mcshading.shadeDatapack('source', 'destination', 'more of the destination', 'more of the source');
```
# mcshading from typescript
install the module globally (recommended) or locally (no `-g` for locally)
```
npm i -g mcshading
```
and then use the module in one of two ways
```ts
import { shadeDatapack } from 'mcshading';
shadeDatapack('source', 'destination', 'more of the destination', 'more of the source');

// or

import * as mcshading from 'mcshading';
mcshading.shadeDatapack('source', 'destination', 'more of the destination', 'more of the source');
```

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