purescript-node / purescript-node-fs

Node.js file I/O for purescript
MIT License
33 stars 34 forks source link

feat: implement glob, cp, opendir and other methods #86

Open srghma opened 2 weeks ago

srghma commented 2 weeks ago

Description of the change

implement https://github.com/purescript-node/purescript-node-fs/issues/82#issuecomment-2392621528

but not watchfiles

used this to play in js

var fs = require('fs').promises;
var path = require('path');
var dir = await fs.opendir(
  '/home/srghma/projects/purescript-tidy-codegen/src',
  {
    // encoding: 'buffer',
    encoding: 'ascii',
    recursive: true
  }
);
console.log(dir);
console.log(dir.readSync());

for await (var dirent of dir) {
  console.log('await', dirent);
}
// var dir = await fs.glob(
//   '**/*.purs',
//   {
//     cwd: '/home/srghma/projects/purescript-tidy-codegen/src',
//     withFileTypes: false,
//     exclude: (x) => console.log('filter', x)
//   }
// );
//
//
// var dir = await fs.readdir(
//   '/home/srghma/projects/purescript-tidy-codegen/src',
//   {
//     encoding: 'buffer',
//     withFileTypes: true,
//     recursive: false
//   }
// );
// 

Checklist:

srghma commented 2 weeks ago

I think done