Skip to content

Commit a1ed8c2

Browse files
committed
docs: 更新 readme
1 parent 580c308 commit a1ed8c2

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

.npmignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@ Scene: generate a templates, then replace initName to newName.
1313

1414
```sh
1515
# npm
16-
npm install --save tiny-replace-files
16+
npm install --save tiny-replace-files fast-glob
1717

1818
# yarn
19-
yarn add tiny-replace-files
19+
yarn add tiny-replace-files fast-glob
2020

2121
# pnpm
22-
pnpm install --save tiny-replace-files
22+
pnpm install --save tiny-replace-files fast-glob
2323
```
2424

2525
### usage
2626

2727
#### Sync
2828

2929
```ts
30-
import { replaceStringInFiles } from 'tiny-replace-files'
30+
import { replaceStringInFilesSync } from 'tiny-replace-files'
3131

3232
const options = {
3333
files: 'src/targets/index.js',
@@ -36,7 +36,7 @@ const options = {
3636
}
3737

3838
# await
39-
const result = replaceStringInFiles(options)
39+
const result = replaceStringInFilesSync(options)
4040
console.info(result)
4141
/**
4242
[
@@ -148,6 +148,7 @@ const options = {
148148

149149
#### Disable globs
150150

151+
do not use fast-glob to get path. if you config this, you can uninstall fast-glob for reduce pkg size.
151152
```ts
152153
const options = {
153154
disableGlobs: true,

package.json

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
2-
"name": "ts-npm-template-simple",
2+
"name": "tiny-replace-files",
33
"version": "1.0.0",
4-
"description": "使用 tsup 构建 ts lib",
5-
"main": "dist/index.min.js",
6-
"module": "dist/index.min.js",
4+
"description": "tiny replace string/regex in files.",
5+
"main": "dist/index.js",
6+
"module": "dist/index.js",
77
"types": "dist/types/index.d.ts",
88
"directories": {
99
"test": "test"
1010
},
1111
"scripts": {
12-
"build-fast": "tsup src/index.ts --format cjs,esm --minify",
13-
"build": "yarn build-fast --dts",
12+
"build-fast": "tsup src/index.ts --dts --format cjs,esm --minify",
13+
"build": "yarn build-fast",
1414
"watch": "tsup src/index.ts --watch",
1515
"test": "uvu -r sucrase/register --ignore fixture",
1616
"prepublishOnly": "yarn build-fast",
@@ -25,7 +25,7 @@
2525
},
2626
"repository": {
2727
"type": "git",
28-
"url": "git+https://github.com/npm-template/js-npm-template.git"
28+
"url": "https://github.com/Rabbitzzc/tiny-replace-files"
2929
},
3030
"keywords": [
3131
"js-npm-template",
@@ -35,14 +35,15 @@
3535
"author": "Rabbitzzc",
3636
"license": "MIT",
3737
"bugs": {
38-
"url": "https://github.com/npm-template/js-npm-template/issues"
38+
"url": "https://github.com/Rabbitzzc/tiny-replace-files/issues"
3939
},
40-
"homepage": "https://github.com/npm-template/js-npm-template#readme",
40+
"homepage": "https://github.com/Rabbitzzc/tiny-replace-files",
4141
"engines": {
4242
"node": ">=10.0.0"
4343
},
4444
"files": [
45-
"lib/index.min.js"
45+
"dist/index.js",
46+
"dist/index.mjs"
4647
],
4748
"peerDependencies": {
4849
"fast-glob": "3.2.7"

0 commit comments

Comments
 (0)