{"library":"node-fs","title":"node-fs: Legacy FS Extension","description":"node-fs is an extension library for Node.js's native `fs` module, originally designed for very early Node.js versions (specifically, requiring Node.js >=0.1.97). It aimed to provide functionalities that were not natively available in the `fs` module at the time, such as recursive directory creation (`fs.createDirectory`, `fs.mkdirSyncRecursive`) and recursive directory removal (`fs.remove`, `fs.rmdirSyncRecursive`), as well as recursive directory watching (`fs.watchTree`). The package's last update was in 2011, and it reached version 0.1.7. Given the significant advancements in Node.js's native `fs` module (e.g., recursive options for `fs.mkdir` and `fs.rm` are standard since Node.js v10.12.0 and v12.10.0 respectively), `node-fs` is now obsolete. Modern Node.js versions provide these features natively, making this package unnecessary and incompatible with current development practices. It has no ongoing maintenance or active development.","language":"javascript","status":"abandoned","last_verified":"Sun Apr 19","install":{"commands":["npm install node-fs"],"cli":null},"imports":["const fs = require('node-fs');","const fs = require('node-fs');\nfs.createDirectory('./path/to/dir', 0o777, (err) => { /* ... */ });","const fs = require('node-fs');\nfs.remove('./path/to/remove', (err) => { /* ... */ });"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const fs = require('node-fs');\nconst path = require('path');\n\nconst dirToCreate = path.join(__dirname, 'test-dir-legacy/sub-dir');\nconst fileToCopy = path.join(__dirname, 'test-file.txt');\nconst copiedFile = path.join(__dirname, 'test-dir-legacy/copied-file.txt');\n\n// Create a dummy file for copying\nrequire('fs').writeFileSync(fileToCopy, 'Hello from the past!');\n\nconsole.log('Attempting to create directory recursively with node-fs...');\nfs.createDirectory(dirToCreate, 0o777, true, (err) => {\n  if (err) {\n    console.error('Error creating directory:', err);\n    return;\n  }\n  console.log(`Directory created: ${dirToCreate}`);\n\n  console.log('Attempting to copy file with node-fs...');\n  fs.copy(fileToCopy, copiedFile, (err) => {\n    if (err) {\n      console.error('Error copying file:', err);\n      return;\n    }\n    console.log(`File copied from ${fileToCopy} to ${copiedFile}`);\n\n    // Clean up (using modern fs for robust cleanup)\n    console.log('Cleaning up...');\n    require('fs').unlinkSync(fileToCopy);\n    require('fs').unlinkSync(copiedFile);\n    require('fs').rmdirSync(path.dirname(dirToCreate), { recursive: true });\n    console.log('Cleanup complete.');\n  });\n});","lang":"javascript","description":"Demonstrates `node-fs`'s recursive directory creation and file copying features, then cleans up using modern Node.js `fs` methods.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}