Skip to content

Commit 975695f

Browse files
committed
chore: rename
1 parent 6665389 commit 975695f

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# DirWalk
1+
# SpeedWalk
22

33
[![TypeScript](https://badgen.net/badge/-/TypeScript/blue?icon=typescript&label)](https://www.typescriptlang.org/) [![Install size](https://packagephobia.com/badge?p=dirwalk@latest)](https://packagephobia.com/result?p=dirwalk@latest)
44

@@ -17,7 +17,7 @@ Walk an entire directory. Fast, simple, and asynchronous.
1717
Import the `walk` function from the package. To call it, pass in a root directory and a callback function accepting a `path` and a `dirent`.
1818

1919
```TypeScript
20-
import { walk } from 'dirwalk';
20+
import { walk } from 'speedwalk';
2121

2222
await walk('./', (path, dirent) => {
2323
console.log('Path:', path);
@@ -30,7 +30,7 @@ The function will asynchronously traverse the directory and any subsequent direc
3030
You may want to ignore a directory. Tell `walk` to skip the traversal of a certain directory by returning `true` from the callback.
3131

3232
```TypeScript
33-
import { walk } from '../index.js';
33+
import { walk } from 'speedwalk';
3434

3535
await walk('./', (path, dirent) => {
3636
console.log('Path:', path);

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "dirwalk",
2+
"name": "speedwalk",
33
"version": "0.0.1",
44
"description": "Walk an entire directory. Fast, simple, and asynchronous.",
55
"main": "./build/index.js",
@@ -13,7 +13,11 @@
1313
},
1414
"repository": {
1515
"type": "git",
16-
"url": "https://github.com/mstephen19/dirwalk"
16+
"url": "https://github.com/mstephen19/speedwalk"
17+
},
18+
"homepage": "https://github.com/mstephen19/speedwalk#readme",
19+
"bugs": {
20+
"url": "https://github.com/mstephen19/speedwalk/issues"
1721
},
1822
"keywords": [
1923
"walk",

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { opendir } from 'fs/promises';
22
import { join } from 'path';
33

4-
import type { DirWalkCallback } from './types.js';
4+
import type { WalkDirCallback } from './types.js';
55

66
/**
77
* Traverse an entire directory's files and all subsequent subdirectories.
@@ -10,7 +10,7 @@ import type { DirWalkCallback } from './types.js';
1010
* @param callback A callback function to run for each file found.
1111
* @returns
1212
*/
13-
export async function walk(root: string, callback: DirWalkCallback): Promise<void> {
13+
export async function walk(root: string, callback: WalkDirCallback): Promise<void> {
1414
// Open the directory
1515
const dir = await opendir(root);
1616

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ type Awaitable<T> = T | Promise<T>;
55
/**
66
* A callback function to run for each file found.
77
*/
8-
export type DirWalkCallback = (path: string, dir: Dirent) => Awaitable<void | boolean>;
8+
export type WalkDirCallback = (path: string, dir: Dirent) => Awaitable<void | boolean>;

0 commit comments

Comments
 (0)