socket
socket copied to clipboard
Support 'URL' and 'path.Path' instances as input to `fs.*` APIs
It will be a nice experience to support URL (and path.Path) instances to various fs.* APIs
import URL from 'socket:url'
import fs from 'socket:fs/promises'
const dirname = new URL('./directory', .import.meta.url)
const entries = fs.readdir(dirname)
The URL instance could be a fully qualified URL with the socket: protocol so this should be considered when converting these instances to path strings:
// this could be 'socket://com.company.application/pages/directory'
const dirname = new URL('./directory', .import.meta.url)
// which should become './pages/directory' internally for various `fs.*` APIs as the internal current working directory (.)
// will be the resources directory on desktop + ios (or the `files/` directory on Android)
Hello, I am new to open source but would like to contribute. I'm not sure of the procedure, so any guidance is appreciated!
@pmettaprasert Please feel free to open a PR and call out a reviewer to look at and merge your code.
We have a contributing guide here https://github.com/socketsupply/socket/blob/master/CONTRIBUTING.md