# @jswork/next-replace-in-file

> File content replace for next.

Latest version **1.0.0** (published 2020-11-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @jswork/next-replace-in-file
pnpm add @jswork/next-replace-in-file
yarn add @jswork/next-replace-in-file
bun add @jswork/next-replace-in-file
```

## 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 | 2020-11-17 |
| First published | 2020-11-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 7.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | afei |
| Maintainers | afeiship |
| Keywords | next, file, replace, in, content, string, regexp, glob, pattern, globby |

## Links

- npm: https://www.npmjs.com/package/@jswork/next-replace-in-file
- Homepage: https://github.com/afeiship/next-replace-in-file
- npm.io page: https://npm.io/package/@jswork/next-replace-in-file

## Dependencies (1)

- [@jswork/next-array-replace](https://npm.io/package/@jswork/next-array-replace.md) ^1.0.0

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2020-11-17

## README

# next-replace-in-file
> File content replace for next.

[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

## installation
```bash
npm install -S @jswork/next-replace-in-file
```

## usage
> Basic usage.
  ```js
  import '@feizheng/next-replace-in-file';

  // basic usage:
  nx.replaceInFile('test/**', [[/VERSION/gi, 'version']]);
  nx.replaceInFile(['**','!node_modules'], [[/VERSION/gi, 'version']]);

  // or you can multiple replace:
  nx.replaceInFile(
    'test/**',
    [
      [/VERSION/gi, '_VERSION_'],
      [/file/g, 'FILE'],
      [/description/g,'DESC'],
    ],
    {
      ignore: ['*/test.js']
    }
  );
  ```

## globby
> Just a quick overview.

  - `*` matches any number of characters, but not `/`
  - `?` matches a single character, but not `/`
  - `**` matches any number of characters, including `/`, as long as it's the only thing in a path part
  - `{}` allows for a comma-separated list of "or" expressions
  - `!` at the beginning of a pattern will negate the match

## options
> Not fully, because `fast-glob` does not implement all options of `node-glob`. See table below.

  | node-glob(😂) |                        fast-glob(😎)                         |
  | :----------: | :---------------------------------------------------------: |
  |    `cwd`     |                        [`cwd`](#cwd)                        |
  |    `root`    |                              –                              |
  |    `dot`     |                        [`dot`](#dot)                        |
  |  `nomount`   |                              –                              |
  |    `mark`    |            [`markDirectories`](#markdirectories)            |
  |   `nosort`   |                              –                              |
  |  `nounique`  |                     [`unique`](#unique)                     |
  |  `nobrace`   |         [`nobrace`](#nobrace) or [`brace`](#brace)          |
  | `noglobstar` |   [`noglobstar`](#noglobstar) or [`globstar`](#globstar)    |
  |   `noext`    |       [`noext`](#noext) or [`extension`](#extension)        |
  |   `nocase`   |           [`nocase`](#nocase) or [`case`](#case)            |
  | `matchBase`  |                  [`matchbase`](#matchbase)                  |
  |   `nodir`    |                  [`onlyFiles`](#onlyfiles)                  |
  |   `ignore`   |                     [`ignore`](#ignore)                     |
  |   `follow`   | [`followSymlinkedDirectories`](#followsymlinkeddirectories) |
  |  `realpath`  |                              –                              |
  |  `absolute`  |                   [`absolute`](#absolute)                   |


## resources
  - https://github.com/afeiship/next-array-replace
  - https://github.com/sindresorhus/globby
  - https://github.com/mrmlnc/fast-glob#options-1

## license
Code released under [the MIT license](https://github.com/afeiship/next-replace-in-file/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@jswork/next-replace-in-file
[version-url]: https://npmjs.org/package/@jswork/next-replace-in-file

[license-image]: https://img.shields.io/npm/l/@jswork/next-replace-in-file
[license-url]: https://github.com/afeiship/next-replace-in-file/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-replace-in-file
[size-url]: https://github.com/afeiship/next-replace-in-file/blob/master/dist/next-replace-in-file.min.js

[download-image]: https://img.shields.io/npm/dm/@jswork/next-replace-in-file
[download-url]: https://www.npmjs.com/package/@jswork/next-replace-in-file

---
_Source: https://npm.io/package/@jswork/next-replace-in-file · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
