{"_id":"@allnulled/universal-file-system","_rev":"2-9720bef57ffe4ed2f0af91e80c9bd894","name":"@allnulled/universal-file-system","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@allnulled/universal-file-system","version":"1.0.0","keywords":[],"author":"","license":"WTFPL","_id":"@allnulled/universal-file-system@1.0.0","maintainers":[{"name":"allnulled","email":"todosanulados@gmail.com"}],"dist":{"shasum":"d0049ff88c9fbebbc427b970bd9939ad66fd51f1","tarball":"https://registry.npmjs.org/@allnulled/universal-file-system/-/universal-file-system-1.0.0.tgz","fileCount":9,"integrity":"sha512-PjdS7TmQorMsR0pzrkDQ3idezIEw5HbRbER5bQUHVTf39XUo57RkXnXo/PVi4vUFvs/yKxvndKjVp2PxuZnnWw==","signatures":[{"sig":"MEQCIEIIJ67bGQCzBl7Swp5CRfeo8NQ/Ple4dc/HDrNtFfMBAiB5KwN7XU75ApXXva49xoIyLrluyu693O+KTfMGJNtx2g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59235},"main":"ufs.js","gitHead":"7d89c1bf1341a7b122c9d6a2b92dbf1f0daeda74","scripts":{"dev":"node build/dev.js","test":"npm run test:node && npm run test:browser","build":"node build/build.js","test:node":"node test/node/test.js","test:browser":"npx http-server -c-1 test/browser -o"},"_npmUser":{"name":"allnulled","email":"todosanulados@gmail.com"},"_npmVersion":"9.6.7","description":"Usa localStorage en browser y fs en node.js.","directories":{"test":"test"},"_nodeVersion":"18.17.1","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^10.7.3"},"_npmOperationalInternal":{"tmp":"tmp/universal-file-system_1.0.0_1734344595313_0.029521301864378957","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@allnulled/universal-file-system","version":"1.0.1","keywords":[],"author":"","license":"WTFPL","_id":"@allnulled/universal-file-system@1.0.1","maintainers":[{"name":"allnulled","email":"todosanulados@gmail.com"}],"dist":{"shasum":"ba990068f6d74b36758921c475c497a06e06873c","tarball":"https://registry.npmjs.org/@allnulled/universal-file-system/-/universal-file-system-1.0.1.tgz","fileCount":10,"integrity":"sha512-XD0zxA9bY4VeSD7ulnRI6909qGKnsfB4cbfpwBi4S0ByCf/OJ3V0vn87A+DUNqEO2EI2M100Em8EnOhp/lhUhw==","signatures":[{"sig":"MEUCIBX8AdEuyc8MoevvTCFWhdi27mDTV3OD9d2OsoMd2KZUAiEAvFCPw8OmQpnNicWHrXDQrp1Gon5xxGdYN1rbhE4n0jM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":84810},"main":"dist/ufs.js","gitHead":"42c70be2b98e3e8681b7527d8332f39a65a71fb7","scripts":{"dev":"node build/dev.js","test":"npm run test:node && npm run test:browser","build":"node build/build.js","test:node":"node test/node/test.js","test:browser":"npx http-server -c-1 test/browser -o"},"_npmUser":{"name":"allnulled","email":"todosanulados@gmail.com"},"_npmVersion":"9.6.7","description":"Usa localStorage en browser y fs en node.js.","directories":{"test":"test"},"_nodeVersion":"18.17.1","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^10.7.3"},"_npmOperationalInternal":{"tmp":"tmp/universal-file-system_1.0.1_1738754685109_0.7653392217425625","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@allnulled/universal-file-system","version":"1.0.2","main":"dist/ufs.js","scripts":{"dev":"node build/dev.js","build":"node build/build.js","test":"npm run test:node && npm run test:browser","test:browser":"npx http-server -c-1 test/browser -o","test:node":"node test/node/test.js"},"keywords":[],"author":"","license":"WTFPL","description":"Usa localStorage en browser y fs en node.js.","directories":{"test":"test"},"gitHead":"12797615bc84a0c7f3c4a2dde53d809d5e0c5867","_id":"@allnulled/universal-file-system@1.0.2","_nodeVersion":"18.17.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-4izKES9nB5+QJEz95XpvxTwIyJQGpfMdObSHK1Sc1SQtNT9cV2iFepkRUEQF7X1CZROUId8t0pvdRT7qYwIFcQ==","shasum":"5ad920270e4ea557253bc4ef5a22558f674e0ab1","tarball":"https://registry.npmjs.org/@allnulled/universal-file-system/-/universal-file-system-1.0.2.tgz","fileCount":10,"unpackedSize":84729,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBKeA61+BDR4HWgXaXa2zTLMCe9RBeNvbZ3AvWe7xlnVAiBsi7b6T3msUmP6nSsD4DhKnsqr4NQSF09V/R0XA+tjhQ=="}]},"_npmUser":{"name":"allnulled","email":"todosanulados@gmail.com"},"maintainers":[{"name":"allnulled","email":"todosanulados@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/universal-file-system_1.0.2_1738754779934_0.6782636453166819"},"_hasShrinkwrap":false}},"time":{"created":"2024-12-16T10:23:15.197Z","modified":"2025-02-05T11:26:20.289Z","1.0.0":"2024-12-16T10:23:15.468Z","1.0.1":"2025-02-05T11:24:45.346Z","1.0.2":"2025-02-05T11:26:20.108Z"},"license":"WTFPL","keywords":[],"description":"Usa localStorage en browser y fs en node.js.","maintainers":[{"name":"allnulled","email":"todosanulados@gmail.com"}],"readme":"# universal-file-system\n\nSistema de ficheros universal, para node.js y browser.\n\nNo tiene dependencias y funciona igual en browser como en node.js.\n\n## Instalación\n\n```sh\nnpm install @allnulled/universal-file-system\n```\n\n## API\n\nUsa localStorage o IDB en browser y fs en node.js.\n\nLos métodos son síncronos, y son estos:\n\n- `resolve_path(...args)`: devuelve la tura completa al nodo fs. Como `path.resolve`.\n- `get_current_directory()`: devuelve el directorio actual.\n- `make_directory(dir)`: crea un directorio.\n- `change_directory(dir)`: mueve el directorio actual.\n- `write_file(file, content)`: (sobre)escribe un nuevo fichero.\n- `read_directory(dir)`: lista los nodos del directorio.\n- `read_file(file)`: lee el contenido del fichero.\n- `delete_file(file)`: elimina el directorio.\n- `delete_directory(dir)`: elimina el fichero.\n- `exists(node)`: devuelve si existe o no.\n- `is_file(node)`: devuelve si es fichero o no.\n- `is_directory(node)`: devuelve si es directorio o no.\n- `rename(name, newName)`: le cambia el nombre a un fichero o directorio.\n\n## Uso\n\nPara empezar a usarlo bien, deberías especificar el driver que quieres usar, y las opciones son estas:\n\n```js\nconst nodeFs = UFS_manager.driver(\"node\").create();\nconst localStorageFs = UFS_manager.driver(\"localStorage\").create(dbId);\nconst idbFs = UFS_manager.driver(\"idb\").create(dbId);\n```\n\nLuego ya puedes usar la API que sea de la misma forma, con las salvedades que tenga, como llamadas asíncronas, o API interna, pero los contratos de los métodos son prácticamente iguales.\n\n## Test\n\nPuedes ver los tests dentro.","readmeFilename":"README.md"}