0.0.10 • Published 2 years ago

@u7/walk v0.0.10

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

@u7/walk

walk directory recursive

安装

推荐用 @antfu/ni

ni -D @u7/walk

使用

→ test/index.coffee

#!/usr/bin/env coffee

import walk, {walkRel} from '@u7/walk'
import {dirname} from 'path'

{pathname} = new URL(import.meta.url)

dir = dirname dirname pathname

console.log dir

console.log '> full path'
for await i from walk(dir)
  console.log i

console.log '\n> relative path'
for await i from walkRel(
  dir
  (i)=>
    i == 'src'
)
  console.log '\t',i