# commonform-substitute

> substitute terms and headings in Common Forms

Latest version **1.1.0** (published 2022-06-16) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install commonform-substitute
pnpm add commonform-substitute
yarn add commonform-substitute
bun add commonform-substitute
```

## 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.1.0 |
| Published | 2022-06-16 |
| First published | 2018-01-12 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Kyle E. Mitchell |
| Maintainers | kemitchell |

## Links

- npm: https://www.npmjs.com/package/commonform-substitute
- Repository: https://github.com/commonform/commonform-substitute
- Homepage: https://github.com/commonform/commonform-substitute#readme
- Issues: https://github.com/commonform/commonform-substitute/issues
- npm.io page: https://npm.io/package/commonform-substitute

## Recent versions

- 1.1.0 (latest) — 2022-06-16
- 1.0.1 — 2018-06-04
- 1.0.0 — 2018-01-12

## README

substitute terms and headings in Common Forms

```javascript
var assert = require('assert')
var substitute = require('commonform-substitute')

assert.deepEqual(
  substitute(
    {
      content: [
        {
          heading: 'Banana',
          form: {
            content: [
              {definition: 'Apple'},
              {blank: ''}
            ]
          }
        },
        {
          heading: 'Rock',
          form: {
            content: [
              {use: 'Apple'},
              {reference: 'Banana'},
              {blank: ''}
            ]
          }
        }
      ]
    }, {
      terms: {'Apple': 'Orange'},
      headings: {'Banana': 'Pear'},
      blanks: {'2': 'Watermelon'}
    }
  ),
  {
    content: [
      {
        heading: 'Pear',
        form: {
          content: [
            {definition: 'Orange'},
            {blank: ''}
          ]
        }
      },
      {
        heading: 'Rock',
        form: {
          content: [
            {use: 'Orange'},
            {reference: 'Pear'},
            'Watermelon'
          ]
        }
      }
    ]
  }
)
```

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