Skip to content

Commit 4ac0a3f

Browse files
committedOct 27, 2020
docs: update
1 parent ff394e8 commit 4ac0a3f

File tree

6 files changed

+19
-9
lines changed

6 files changed

+19
-9
lines changed
 

‎docs/404.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><link rel="icon" href="/fs/favicon.ico"/><title>404 - not found</title><meta name="description" content="404 - not found."/><script type="application/ld+json">{"@context":"http://schema.org","@type":"website","name":"404 - not found"}</script><link rel="stylesheet" href="/fs/magic.css?DIusUD77fC" integrity="sha384-DIusUD77fCYxDczsgY9DjhmjdD/idZEn/NGVWo4QtcpSxysCher8U2D4waANcW+H" crossorigin="anonymous"/></head><body><a class="SkipLink" href="/fs/#page">Skip to Content</a><main id="Magic"><div class="Wrapper"><header class="Header"><div><a class="Logo" href="/fs/"><svg viewBox="0 0 512 444"><path d="M512 444L256 0 0 444z" fill="#663695"></path><circle cx="256" cy="294" r="130" fill="#fff"></circle><circle cx="256" cy="281" r="40" fill="#663695"></circle><path d="M256 350v44m24-44l1 13c1 27 29 27 29-7m-160-72s46-47 106-47c59 0 106 47 106 47s-47 43-106 43c-60 0-106-43-106-43zm65-75a134 134 0 0189 2" class="stroke"></path><path d="M256 81v53m184 270l-43-29M72 404l43-29" class="stroke white"></path></svg></a><p>@magic/fs</p><nav class="Menu"><ul><li><a href="/fs/#install">install</a></li><li><a href="/fs/#import">import</a></li><li><a href="/fs/#usage">usage</a></li><li><a href="/fs/#source">source</a></li></ul></nav></div></header><div class="Page" id="page"><div>404 - not found.</div></div><footer class="Footer"><div class="Container"><div class="Credits">made with a few bits of <a target="_blank" rel="noopener" href="https://magic.github.io/">magic</a></div></div></footer></div></main><script src="/fs/magic.js?2+tHb+tnw1" integrity="sha384-2+tHb+tnw1Dj4NsqlZBPgIhPOTxjIHVteQh6kEigjj3Q4ovXNgxXJbp50XkUD3BJ" crossorigin="anonymous"></script></body></html>
1+
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><link rel="icon" href="/fs/favicon.ico"/><title>404 - not found</title><meta name="description" content="404 - not found."/><script type="application/ld+json">{"@context":"http://schema.org","@type":"website","name":"404 - not found"}</script><link rel="stylesheet" href="/fs/magic.css?DIusUD77fC" integrity="sha384-DIusUD77fCYxDczsgY9DjhmjdD/idZEn/NGVWo4QtcpSxysCher8U2D4waANcW+H" crossorigin="anonymous"/></head><body><a class="SkipLink" href="/fs/#page">Skip to Content</a><main id="Magic"><div class="Wrapper"><header class="Header"><div><a class="Logo" href="/fs/"><svg viewBox="0 0 512 444"><path d="M512 444L256 0 0 444z" fill="#663695"></path><circle cx="256" cy="294" r="130" fill="#fff"></circle><circle cx="256" cy="281" r="40" fill="#663695"></circle><path d="M256 350v44m24-44l1 13c1 27 29 27 29-7m-160-72s46-47 106-47c59 0 106 47 106 47s-47 43-106 43c-60 0-106-43-106-43zm65-75a134 134 0 0189 2" class="stroke"></path><path d="M256 81v53m184 270l-43-29M72 404l43-29" class="stroke white"></path></svg></a><p>@magic/fs</p><nav class="Menu"><ul><li><a href="/fs/#install">install</a></li><li><a href="/fs/#import">import</a></li><li><a href="/fs/#usage">usage</a></li><li><a href="/fs/#source">source</a></li></ul></nav></div></header><div class="Page" id="page"><div>404 - not found.</div></div><footer class="Footer"><div class="Container"><div class="Credits">made with a few bits of <a target="_blank" rel="noopener" href="https://magic.github.io/">magic</a></div></div></footer></div></main><script src="/fs/magic.js?nCX8Yzw3Rw" integrity="sha384-nCX8Yzw3Rw9OaJqzfx3NA8u0xuXuSJ4vH8/l7y/6O8e882Y72t1TS784vnAVim9M" crossorigin="anonymous"></script></body></html>

‎docs/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><link rel="icon" href="/fs/favicon.ico"/><title>@magic/fs</title><meta name="description" content="nodejs fs promises and goodies."/><script type="application/ld+json">{"@context":"http://schema.org","@type":"website","name":"@magic/fs"}</script><link rel="stylesheet" href="/fs/magic.css?DIusUD77fC" integrity="sha384-DIusUD77fCYxDczsgY9DjhmjdD/idZEn/NGVWo4QtcpSxysCher8U2D4waANcW+H" crossorigin="anonymous"/></head><body><a class="SkipLink" href="/fs/#page">Skip to Content</a><main id="Magic"><div class="Wrapper"><header class="Header"><div><a class="Logo" href="/fs/"><svg viewBox="0 0 512 444"><path d="M512 444L256 0 0 444z" fill="#663695"></path><circle cx="256" cy="294" r="130" fill="#fff"></circle><circle cx="256" cy="281" r="40" fill="#663695"></circle><path d="M256 350v44m24-44l1 13c1 27 29 27 29-7m-160-72s46-47 106-47c59 0 106 47 106 47s-47 43-106 43c-60 0-106-43-106-43zm65-75a134 134 0 0189 2" class="stroke"></path><path d="M256 81v53m184 270l-43-29M72 404l43-29" class="stroke white"></path></svg></a><p>@magic/fs</p><nav class="Menu"><ul><li><a href="/fs/#install">install</a></li><li><a href="/fs/#import">import</a></li><li><a href="/fs/#usage">usage</a></li><li><a href="/fs/#source">source</a></li></ul></nav></div></header><div class="Page" id="page"><h1>@magic/fs</h1><p>nodejs fs promises and goodies.</p><ul class="GitBadges"><li><a href="https://www.npmjs.com/package/fs" target="_blank" rel="noopener"><img src="https://img.shields.io/npm/v/magic/fs?color=blue" height="23" role="presentation" alt="" loading="lazy"/></a></li><li><img src="https://img.shields.io/node/v/magic/fs?color=blue" height="23" role="presentation" alt="" loading="lazy"/></li><li><img src="https://img.shields.io/npm/l/magic/fs?color=blue" height="23" role="presentation" alt="" loading="lazy"/></li><li><a href="https://travis-ci.com/magic/fs" target="_blank" rel="noopener"><img src="https://img.shields.io/travis/com/magic/fs/master" height="23" role="presentation" alt="" loading="lazy"/></a></li><li><a href="https://ci.appveyor.com/project/magic/fs/branch/master" target="_blank" rel="noopener"><img src="https://img.shields.io/appveyor/ci/magic/fs/master.svg" height="23" role="presentation" alt="" loading="lazy"/></a></li><li><a href="https://coveralls.io/github/magic/fs" target="_blank" rel="noopener"><img src="https://img.shields.io/coveralls/github/magic/fs/master.svg" height="23" role="presentation" alt="" loading="lazy"/></a></li><li><a href="https://snyk.io/test/github/magic/fs" target="_blank" rel="noopener"><img src="https://img.shields.io/snyk/vulnerabilities/github/magic/fs.svg" height="23" role="presentation" alt="" loading="lazy"/></a></li></ul><h3 id="install">install</h3><p>be in a nodejs project</p><div class="Pre lines"><div class="menu"><button>copy</button></div><pre><code class="line"><span class="keyword">npm</span> i --save-dev @magic/fs</code></pre></div><h3 id="import">import</h3><div class="Pre lines"><div class="menu"><button>copy</button></div><pre><code class="line"><span class="keyword">import</span> fs from <span class="string">&#39;@magic/fs&#39;</span></code><code class="line"></code><code class="line"><span class="keyword">const</span> run = <span class="keyword">async</span> () <span class="keyword">=&gt;</span> {</code><code class="line"> <span class="keyword">await</span> fs.mkdirp(<span class="string">&#39;./test_235235/dir/to/create&#39;</span>)</code><code class="line"> console.log(<span class="string">&#39;dir created&#39;</span>)</code><code class="line"> <span class="keyword">await</span> fs.rmrf(<span class="string">&#39;./test_235235&#39;</span>)</code><code class="line"> console.log(<span class="string">&#39;dir deleted, even though it had contents.&#39;</span>)</code><code class="line">}</code><code class="line">run()</code></pre></div><h3 id="usage">usage</h3><h4 id="usage-promises">promises</h4><p>promises from fs</p><ul><li>access</li><li>copyFile</li><li>open</li><li>opendir</li><li>rename</li><li>truncate</li><li>rmdir</li><li>mkdir</li><li>readdir</li><li>readlink</li><li>symlink</li><li>lstat</li><li>stat</li><li>link</li><li>unlink</li><li>chmod</li><li>lchmod</li><li>lchown</li><li>chown</li><li>utimes</li><li>realpath</li><li>mkdtemp</li><li>writeFile</li><li>appendFile</li><li>readFile</li><li>exists</li><li>readDir</li><li>readfile</li><li>rmDir</li></ul><h4 id="usage-overloads">export overloads</h4><ul><li>rmdir, rmDir</li><li>readfile, readFile</li><li>readdir, readDir</li></ul><h4 id="usage-additional">additional functions</h4><h5 id="usage-mkdirp">mkdirp</h5><p>same as mkdir -p on unix</p><div class="Pre lines"><div class="menu"><button>copy</button></div><pre><code class="line"><span class="keyword">await</span> fs.mkdirp(<span class="string">&#39;./path/to/dir&#39;</span>)</code></pre></div><h5 id="usage-rmrf">rmrf</h5><p>same as rm -rf on unix.</p><p><strong>will not work outside process.cwd()</strong></p><div class="Pre lines"><div class="menu"><button>copy</button></div><pre><code class="line"><span class="keyword">await</span> fs.rmrf(<span class="string">&#39;./path/to/dir&#39;</span>)</code></pre></div><h5 id="usage-exists">exists</h5><p>same as fs.exists, but promisified.</p><h5 id="usage-getDirectories">getDirectories</h5><p>get a list of directories in a directory, recursively.</p><div class="Pre lines"><div class="menu"><button>copy</button></div><pre><code class="line"><span class="keyword">import</span> fs from <span class="string">&#39;@magic/fs&#39;</span></code><code class="line"></code><code class="line"><span class="keyword">const</span> run = <span class="keyword">async</span> () <span class="keyword">=&gt;</span> {</code><code class="line"> <span class="comment">// first level directories</span></code><code class="line"> <span class="keyword">const</span> directories = <span class="keyword">await</span> fs.getDirectories(process.cwd())</code><code class="line"> console.log(directories)</code><code class="line"></code><code class="line"> <span class="comment">// recursive run</span></code><code class="line"> <span class="keyword">const</span> deepDirectories = <span class="keyword">await</span> fs.getDirectories(process.cwd(), true)</code><code class="line"> console.log(deepDirectories)</code><code class="line">}</code><code class="line">run()</code></pre></div><h4 id="usage-getFiles">getFiles</h4><p>get a list of files in a directory, recursively.</p><div class="Pre lines"><div class="menu"><button>copy</button></div><pre><code class="line"><span class="keyword">import</span> fs from <span class="string">&#39;@magic/fs&#39;</span></code><code class="line"></code><code class="line"><span class="keyword">const</span> run = <span class="keyword">async</span> () <span class="keyword">=&gt;</span> {</code><code class="line"> <span class="comment">// first level files</span></code><code class="line"> <span class="keyword">const</span> files = <span class="keyword">await</span> fs.getFiles(process.cwd())</code><code class="line"> console.log(files)</code><code class="line"></code><code class="line"> <span class="comment">// recursive run</span></code><code class="line"> <span class="keyword">const</span> deepFiles = <span class="keyword">await</span> fs.getFiles(process.cwd(), true)</code><code class="line"> console.log(deepFiles)</code><code class="line">}</code><code class="line">run()</code></pre></div><h5 id="usage-getFileType">getFileType</h5><p>get the file type of a file, based on extension, and defaulting to &quot;txt&quot;</p><div class="Pre lines"><div class="menu"><button>copy</button></div><pre><code class="line"><span class="keyword">import</span> fs from <span class="string">&#39;@magic/fs&#39;</span></code><code class="line"></code><code class="line"><span class="keyword">const</span> fileType = fs.getFileType(<span class="string">&#39;html.html&#39;</span>)</code><code class="line">console.log(fileType, fileType === <span class="string">&#39;html&#39;</span>)</code><code class="line"></code><code class="line"><span class="keyword">const</span> nonFileType = fs.getFileType()</code><code class="line">console.log(nonFileType, nonFileType === <span class="string">&#39;txt&#39;</span>)</code></pre></div><h2 id="source">source</h2><p>the source for this page is in the <a href="https://github.com/magic/fs/tree/master/example" target="_blank" rel="noopener">example directory</a> and gets built and published to github using <a href="https://github.com/magic/core" target="_blank" rel="noopener">@magic/core</a></p></div><footer class="Footer"><div class="Container"><div class="Credits">made with a few bits of <a target="_blank" rel="noopener" href="https://magic.github.io/">magic</a></div></div></footer></div></main><script src="/fs/magic.js?2+tHb+tnw1" integrity="sha384-2+tHb+tnw1Dj4NsqlZBPgIhPOTxjIHVteQh6kEigjj3Q4ovXNgxXJbp50XkUD3BJ" crossorigin="anonymous"></script></body></html>
1+
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><link rel="icon" href="/fs/favicon.ico"/><title>@magic/fs</title><meta name="description" content="nodejs fs promises and goodies."/><script type="application/ld+json">{"@context":"http://schema.org","@type":"website","name":"@magic/fs"}</script><link rel="stylesheet" href="/fs/magic.css?DIusUD77fC" integrity="sha384-DIusUD77fCYxDczsgY9DjhmjdD/idZEn/NGVWo4QtcpSxysCher8U2D4waANcW+H" crossorigin="anonymous"/></head><body><a class="SkipLink" href="/fs/#page">Skip to Content</a><main id="Magic"><div class="Wrapper"><header class="Header"><div><a class="Logo" href="/fs/"><svg viewBox="0 0 512 444"><path d="M512 444L256 0 0 444z" fill="#663695"></path><circle cx="256" cy="294" r="130" fill="#fff"></circle><circle cx="256" cy="281" r="40" fill="#663695"></circle><path d="M256 350v44m24-44l1 13c1 27 29 27 29-7m-160-72s46-47 106-47c59 0 106 47 106 47s-47 43-106 43c-60 0-106-43-106-43zm65-75a134 134 0 0189 2" class="stroke"></path><path d="M256 81v53m184 270l-43-29M72 404l43-29" class="stroke white"></path></svg></a><p>@magic/fs</p><nav class="Menu"><ul><li><a href="/fs/#install">install</a></li><li><a href="/fs/#import">import</a></li><li><a href="/fs/#usage">usage</a></li><li><a href="/fs/#source">source</a></li></ul></nav></div></header><div class="Page" id="page"><h1>@magic/fs</h1><p>nodejs fs promises and goodies.</p><ul class="GitBadges"><li><a href="https://www.npmjs.com/package/fs" target="_blank" rel="noopener"><img src="https://img.shields.io/npm/v/magic/fs?color=blue" height="23" role="presentation" alt="" loading="lazy"/></a></li><li><img src="https://img.shields.io/node/v/magic/fs?color=blue" height="23" role="presentation" alt="" loading="lazy"/></li><li><img src="https://img.shields.io/npm/l/magic/fs?color=blue" height="23" role="presentation" alt="" loading="lazy"/></li><li><a href="https://travis-ci.com/magic/fs" target="_blank" rel="noopener"><img src="https://img.shields.io/travis/com/magic/fs/master" height="23" role="presentation" alt="" loading="lazy"/></a></li><li><a href="https://ci.appveyor.com/project/magic/fs/branch/master" target="_blank" rel="noopener"><img src="https://img.shields.io/appveyor/ci/magic/fs/master.svg" height="23" role="presentation" alt="" loading="lazy"/></a></li><li><a href="https://coveralls.io/github/magic/fs" target="_blank" rel="noopener"><img src="https://img.shields.io/coveralls/github/magic/fs/master.svg" height="23" role="presentation" alt="" loading="lazy"/></a></li><li><a href="https://snyk.io/test/github/magic/fs" target="_blank" rel="noopener"><img src="https://img.shields.io/snyk/vulnerabilities/github/magic/fs.svg" height="23" role="presentation" alt="" loading="lazy"/></a></li></ul><h3 id="install">install</h3><p>be in a nodejs project</p><div class="Pre lines"><div class="menu"><button>copy</button></div><pre><code class="line"><span class="keyword">npm</span> i --save-dev @magic/fs</code></pre></div><h3 id="import">import</h3><div class="Pre lines"><div class="menu"><button>copy</button></div><pre><code class="line"><span class="keyword">import</span> fs from <span class="string">&#39;@magic/fs&#39;</span></code><code class="line"></code><code class="line"><span class="keyword">const</span> run = <span class="keyword">async</span> () <span class="keyword">=&gt;</span> {</code><code class="line"> <span class="keyword">await</span> fs.mkdirp(<span class="string">&#39;./test_235235/dir/to/create&#39;</span>)</code><code class="line"> console.log(<span class="string">&#39;dir created&#39;</span>)</code><code class="line"> <span class="keyword">await</span> fs.rmrf(<span class="string">&#39;./test_235235&#39;</span>)</code><code class="line"> console.log(<span class="string">&#39;dir deleted, even though it had contents.&#39;</span>)</code><code class="line">}</code><code class="line">run()</code></pre></div><h3 id="usage">usage</h3><h4 id="usage-promises">promises</h4><p>promises from fs</p><ul><li>access</li><li>copyFile</li><li>open</li><li>opendir</li><li>rename</li><li>truncate</li><li>rmdir</li><li>mkdir</li><li>readdir</li><li>readlink</li><li>symlink</li><li>lstat</li><li>stat</li><li>link</li><li>unlink</li><li>chmod</li><li>lchmod</li><li>lchown</li><li>chown</li><li>utimes</li><li>realpath</li><li>mkdtemp</li><li>writeFile</li><li>appendFile</li><li>readFile</li><li>exists</li><li>readDir</li><li>readfile</li><li>rmDir</li></ul><h4 id="usage-overloads">export overloads</h4><ul><li>rmdir, rmDir</li><li>readfile, readFile</li><li>readdir, readDir</li></ul><h4 id="usage-additional">additional functions</h4><h5 id="usage-mkdirp">mkdirp</h5><p>same as mkdir -p on unix</p><div class="Pre lines"><div class="menu"><button>copy</button></div><pre><code class="line"><span class="keyword">await</span> fs.mkdirp(<span class="string">&#39;./path/to/dir&#39;</span>)</code></pre></div><h5 id="usage-rmrf">rmrf</h5><p>same as rm -rf on unix.</p><p><strong>will not work outside process.cwd()</strong></p><div class="Pre lines"><div class="menu"><button>copy</button></div><pre><code class="line"><span class="keyword">await</span> fs.rmrf(<span class="string">&#39;./path/to/dir&#39;</span>)</code></pre></div><h5 id="usage-exists">exists</h5><p>same as fs.exists, but promisified.</p><h5 id="usage-getDirectories">getDirectories</h5><p>get a list of directories in a directory, recursively.</p><div class="Pre lines"><div class="menu"><button>copy</button></div><pre><code class="line"><span class="keyword">import</span> fs from <span class="string">&#39;@magic/fs&#39;</span></code><code class="line"></code><code class="line"><span class="keyword">const</span> run = <span class="keyword">async</span> () <span class="keyword">=&gt;</span> {</code><code class="line"> <span class="comment">// first level directories</span></code><code class="line"> <span class="keyword">const</span> directories = <span class="keyword">await</span> fs.getDirectories(process.cwd())</code><code class="line"> console.log(directories)</code><code class="line"></code><code class="line"> <span class="comment">// recursive run</span></code><code class="line"> <span class="keyword">const</span> deepDirectories = <span class="keyword">await</span> fs.getDirectories(process.cwd(), true)</code><code class="line"> console.log(deepDirectories)</code><code class="line"></code><code class="line"> <span class="comment">// recursive run <span class="keyword">with</span> specified depth, </span></code><code class="line"> <span class="comment">// just pass a number as second argument</span></code><code class="line"> <span class="keyword">const</span> deepDirectoriesDepth2 = <span class="keyword">await</span> fs.getDirectories(process.cwd(), 2)</code><code class="line"> console.log(deepDirectoriesDepth2)</code><code class="line">}</code><code class="line">run()</code></pre></div><h4 id="usage-getFiles">getFiles</h4><p>get a list of files in a directory, recursively.</p><div class="Pre lines"><div class="menu"><button>copy</button></div><pre><code class="line"><span class="keyword">import</span> fs from <span class="string">&#39;@magic/fs&#39;</span></code><code class="line"></code><code class="line"><span class="keyword">const</span> run = <span class="keyword">async</span> () <span class="keyword">=&gt;</span> {</code><code class="line"> <span class="comment">// first level files</span></code><code class="line"> <span class="keyword">const</span> files = <span class="keyword">await</span> fs.getFiles(process.cwd())</code><code class="line"> console.log(files)</code><code class="line"></code><code class="line"> <span class="comment">// recursive run</span></code><code class="line"> <span class="keyword">const</span> deepFiles = <span class="keyword">await</span> fs.getFiles(process.cwd(), true)</code><code class="line"> console.log(deepFiles)</code><code class="line"></code><code class="line"> <span class="comment">// recursive run <span class="keyword">with</span> specified depth, </span></code><code class="line"> <span class="comment">// just pass a number as second argument</span></code><code class="line"> <span class="keyword">const</span> getFilesDepth2 = <span class="keyword">await</span> fs.getFiles(process.cwd(), 2)</code><code class="line"> console.log(getFilesDepth2)</code><code class="line">}</code><code class="line">run()</code></pre></div><h5 id="usage-getFileType">getFileType</h5><p>get the file type of a file, based on extension, and defaulting to &quot;txt&quot;</p><div class="Pre lines"><div class="menu"><button>copy</button></div><pre><code class="line"><span class="keyword">import</span> fs from <span class="string">&#39;@magic/fs&#39;</span></code><code class="line"></code><code class="line"><span class="keyword">const</span> fileType = fs.getFileType(<span class="string">&#39;html.html&#39;</span>)</code><code class="line">console.log(fileType, fileType === <span class="string">&#39;html&#39;</span>)</code><code class="line"></code><code class="line"><span class="keyword">const</span> nonFileType = fs.getFileType()</code><code class="line">console.log(nonFileType, nonFileType === <span class="string">&#39;txt&#39;</span>)</code></pre></div><h2 id="source">source</h2><p>the source for this page is in the <a href="https://github.com/magic/fs/tree/master/example" target="_blank" rel="noopener">example directory</a> and gets built and published to github using <a href="https://github.com/magic/core" target="_blank" rel="noopener">@magic/core</a></p></div><footer class="Footer"><div class="Container"><div class="Credits">made with a few bits of <a target="_blank" rel="noopener" href="https://magic.github.io/">magic</a></div></div></footer></div></main><script src="/fs/magic.js?nCX8Yzw3Rw" integrity="sha384-nCX8Yzw3Rw9OaJqzfx3NA8u0xuXuSJ4vH8/l7y/6O8e882Y72t1TS784vnAVim9M" crossorigin="anonymous"></script></body></html>

‎docs/magic.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎docs/sitemap.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77

88
<url>
99
<loc>https://magic.github.io/fs/</loc>
10-
<lastmod>2020-10-08</lastmod>
10+
<lastmod>2020-10-27</lastmod>
1111
<changefreq>weekly</changefreq>
1212
<priority>0.5</priority>
1313
</url>
1414

1515
<url>
1616
<loc>https://magic.github.io/fs/404/</loc>
17-
<lastmod>2020-10-08</lastmod>
17+
<lastmod>2020-10-27</lastmod>
1818
<changefreq>weekly</changefreq>
1919
<priority>0.5</priority>
2020
</url>

‎docs/sri-hashes.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"/magic.css": "sha384-DIusUD77fCYxDczsgY9DjhmjdD/idZEn/NGVWo4QtcpSxysCher8U2D4waANcW+H",
3-
"/magic.js": "sha384-2+tHb+tnw1Dj4NsqlZBPgIhPOTxjIHVteQh6kEigjj3Q4ovXNgxXJbp50XkUD3BJ",
4-
"/fs/": "sha384-AsrGjwjBMWcaDhlxI+HgoEcjZxLz3eRePtPdac1vybL95LfYImb/hylthkTt4lkr",
5-
"/fs/404/": "sha384-L2vB8u9lM9ZaGMhvey+kKiK++8NOHNYjaHOcafktNyxjAzPnH157zDHe7/+1klUv",
3+
"/magic.js": "sha384-nCX8Yzw3Rw9OaJqzfx3NA8u0xuXuSJ4vH8/l7y/6O8e882Y72t1TS784vnAVim9M",
4+
"/fs/": "sha384-aX+E9aFlzaL7l2rbj9npRx/SSeOqNabDejo7ZE0C1ifI+d19fPrgdR1r/H6OvZUI",
5+
"/fs/404/": "sha384-J+y4suPPcM+TsrXd1Wvmq0s7DCrjvCNR5pBx/2cazZ/8tjqRzKiKo1pBhl/03Da6",
66
"/robots.txt": "sha384-jk+Dct87Q3Kv0rNps1/zaBuZV5VXSWg7e3ZAf47O/EbSjo3ftp3qFST60yrGopOY",
7-
"/sitemap.xml": "sha384-Ntzi8irw/lm5qFhZGfr54BxxyizVsk7hurx+mL3fZiI7skH28IA5C0NXYPO+Tyql"
7+
"/sitemap.xml": "sha384-8X94u4ObECGs0B8435wWxbtHBtSw0p4lPgPcdxaLtaYykN9MA9YEC3qTWwGEqmsP"
88
}

‎docsrc/pages/index.mjs

+10
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ const run = async () => {
9292
// recursive run
9393
const deepDirectories = await fs.getDirectories(process.cwd(), true)
9494
console.log(deepDirectories)
95+
96+
// recursive run with specified depth,
97+
// just pass a number as second argument
98+
const deepDirectoriesDepth2 = await fs.getDirectories(process.cwd(), 2)
99+
console.log(deepDirectoriesDepth2)
95100
}
96101
run()
97102
`),
@@ -110,6 +115,11 @@ const run = async () => {
110115
// recursive run
111116
const deepFiles = await fs.getFiles(process.cwd(), true)
112117
console.log(deepFiles)
118+
119+
// recursive run with specified depth,
120+
// just pass a number as second argument
121+
const getFilesDepth2 = await fs.getFiles(process.cwd(), 2)
122+
console.log(getFilesDepth2)
113123
}
114124
run()
115125
`),

0 commit comments

Comments
 (0)
Please sign in to comment.