repl.txt (854B)
1 2 {{alias}}( path, clbk ) 3 Asynchronously reads the contents of a directory. 4 5 Parameters 6 ---------- 7 path: string|Buffer 8 Directory path. 9 10 clbk: Function 11 Callback to invoke after reading directory contents. 12 13 Examples 14 -------- 15 > function onRead( error, data ) { 16 ... if ( error ) { 17 ... console.error( error.message ); 18 ... } else { 19 ... console.log( data ); 20 ... } 21 ... }; 22 > {{alias}}( './beep/boop', onRead ); 23 24 25 {{alias}}.sync( path ) 26 Synchronously reads the contents of a directory. 27 28 Parameters 29 ---------- 30 path: string|Buffer 31 Directory path. 32 33 Returns 34 ------- 35 out: Error|Array|Array<string> 36 Directory contents. 37 38 Examples 39 -------- 40 > var out = {{alias}}.sync( './beep/boop' ); 41 42 See Also 43 -------- 44