{"_id":"@dhanraj16/uploadnest-sdk","_rev":"6-ecea78215a6c90cd3d6b8361a925e494","name":"@dhanraj16/uploadnest-sdk","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.2":{"name":"@dhanraj16/uploadnest-sdk","version":"1.0.2","keywords":["uploadnest","file-upload","storage","typescript","nodejs","nextjs"],"author":{"name":"Dhanraj Singh"},"license":"Apache-2.0","_id":"@dhanraj16/uploadnest-sdk@1.0.2","maintainers":[{"name":"dhanraj16","email":"dhanrajsingh1512@gmail.com"}],"homepage":"https://github.com/dhanrajsingh16/Uploadnest-npm","bugs":{"url":"https://github.com/dhanrajsingh16/Uploadnest-npm.git"},"dist":{"shasum":"3a3eaa91b27b790c21596cdff89da0ce1c5e9eff","tarball":"https://registry.npmjs.org/@dhanraj16/uploadnest-sdk/-/uploadnest-sdk-1.0.2.tgz","fileCount":26,"integrity":"sha512-uzqdoRaBdr+kyofKI9p667rmd9eO7zhwGJx8QDwbTqdz/p40kiJTY9uIPeF6HfUYoLDqOjAwSJnpK+gjWeZb/A==","signatures":[{"sig":"MEYCIQC0BqcVDatc+0pZ99/6mqMVBr6mPn4v5/RUWU+r1vpSVwIhAN9aSwYrs7lvdMNBt8PaJffRuaP0FkTa2mAun8sWNfGW","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":69037},"main":"./dist/index.cjs","types":"/dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.cjs"},"./types":{"import":"./dist/types.mjs","require":"./dist/types.cjs"},"./errors":{"import":"./dist/errors.mjs","require":"./dist/errors.cjs"}},"gitHead":"90451f1363808d6465912e3d22b5a73e9326b6b9","scripts":{"build":"tsup","clean":"rimraf dist","release":"npm run build && npm run version-packages && npx changeset publish","changeset":"npx changeset","prepublishOnly":"npm run clean && npm run build","version-packages":"npx changeset version"},"_npmUser":{"name":"dhanraj16","email":"dhanrajsingh1512@gmail.com"},"repository":{"url":"git+https://github.com/dhanrajsingh16/Uploadnest-npm.git"},"_npmVersion":"10.9.3","description":"The official TypeScript library for the Uploadnest API","directories":{},"_nodeVersion":"22.18.0","dependencies":{"form-data":"^4.0.4","@dhanraj16/uploadnest-sdk":"^1.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","rimraf":"^6.0.1","typescript":"^5.9.2","@types/node":"^24.3.0"},"_npmOperationalInternal":{"tmp":"tmp/uploadnest-sdk_1.0.2_1756655827214_0.8133944190858651","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@dhanraj16/uploadnest-sdk","version":"1.0.3","keywords":["uploadnest","file-upload","storage","typescript","nodejs","nextjs"],"author":{"name":"Dhanraj Singh"},"license":"Apache-2.0","_id":"@dhanraj16/uploadnest-sdk@1.0.3","maintainers":[{"name":"dhanraj16","email":"dhanrajsingh1512@gmail.com"}],"homepage":"https://github.com/dhanrajsingh16/Uploadnest-npm","bugs":{"url":"https://github.com/dhanrajsingh16/Uploadnest-npm.git"},"dist":{"shasum":"5df6c1e5c574b7d0486a13899eb3a7eecbde3663","tarball":"https://registry.npmjs.org/@dhanraj16/uploadnest-sdk/-/uploadnest-sdk-1.0.3.tgz","fileCount":26,"integrity":"sha512-JpY7QvTMjxi3NNnQ2DeqSmgvRWCq9JzhlJJvic8CxKA0uUy1aqBReQdI+Vzksquc3GbAka0VVY7LO9rfFtD/QQ==","signatures":[{"sig":"MEQCIDAMSNYt5Ln/1cl+YIpxqYvTX1kI1kR9nokaBRfEFljxAiBB4o/fevtgKKi4QcXpzGR9A7IhOrBie6Grq7HKNk1g5w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":68952},"main":"./dist/index.cjs","types":"/dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.cjs"},"./types":{"import":"./dist/types.mjs","require":"./dist/types.cjs"},"./errors":{"import":"./dist/errors.mjs","require":"./dist/errors.cjs"}},"gitHead":"90451f1363808d6465912e3d22b5a73e9326b6b9","scripts":{"build":"tsup","clean":"rimraf dist","release":"npm run build && npm run version-packages && npx changeset publish","changeset":"npx changeset","prepublishOnly":"npm run clean && npm run build","version-packages":"npx changeset version"},"_npmUser":{"name":"dhanraj16","email":"dhanrajsingh1512@gmail.com"},"repository":{"url":"git+https://github.com/dhanrajsingh16/Uploadnest-npm.git"},"_npmVersion":"10.9.3","description":"The official TypeScript library for the Uploadnest API","directories":{},"_nodeVersion":"22.18.0","dependencies":{"form-data":"^4.0.4","@dhanraj16/uploadnest-sdk":"^1.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","rimraf":"^6.0.1","typescript":"^5.9.2","@types/node":"^24.3.0"},"_npmOperationalInternal":{"tmp":"tmp/uploadnest-sdk_1.0.3_1756655945244_0.5790497031858415","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@dhanraj16/uploadnest-sdk","version":"1.0.4","description":"The official TypeScript library for the Uploadnest API","main":"./dist/index.cjs","module":"./dist/index.mjs","types":"/dist/index.d.ts","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.cjs"},"./errors":{"import":"./dist/errors.mjs","require":"./dist/errors.cjs"},"./types":{"import":"./dist/types.mjs","require":"./dist/types.cjs"}},"scripts":{"build":"tsup","clean":"rimraf dist","changeset":"npx changeset","version-packages":"npx changeset version","release":"npm run build && npm run version-packages && npx changeset publish","prepublishOnly":"npm run clean && npm run build"},"repository":{"url":"git+https://github.com/dhanrajsingh16/Uploadnest-npm.git"},"publishConfig":{"access":"public"},"keywords":["uploadnest","file-upload","storage","typescript","nodejs","nextjs"],"author":{"name":"Dhanraj Singh"},"license":"Apache-2.0","dependencies":{"@dhanraj16/uploadnest-sdk":"^1.0.1","form-data":"^4.0.4"},"devDependencies":{"@types/node":"^24.3.0","rimraf":"^6.0.1","tsup":"^8.5.0","typescript":"^5.9.2"},"bugs":{"url":"https://github.com/dhanrajsingh16/Uploadnest-npm.git"},"homepage":"https://github.com/dhanrajsingh16/Uploadnest-npm","_id":"@dhanraj16/uploadnest-sdk@1.0.4","gitHead":"90451f1363808d6465912e3d22b5a73e9326b6b9","_nodeVersion":"22.18.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-xzoDJV0q0jitQoPKs1WZmYiaq9L+gWAFDnr/crWZkARSgTvdmY7TaEJ76HTnUHFeVrgXNd6t1yRKu6azVOsQ3Q==","shasum":"f8bb380b04eb9c55695804024665e31ff8edf98e","tarball":"https://registry.npmjs.org/@dhanraj16/uploadnest-sdk/-/uploadnest-sdk-1.0.4.tgz","fileCount":26,"unpackedSize":66514,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIC+2bVJmVtxXfX4esUlOmUUE4ideYtdPUpXxgNorgabgAiEApkGCv/Piomp6+HoBUJN7e8IqHUlkJNa+mt00ak8gXlU="}]},"_npmUser":{"name":"dhanraj16","email":"dhanrajsingh1512@gmail.com"},"directories":{},"maintainers":[{"name":"dhanraj16","email":"dhanrajsingh1512@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/uploadnest-sdk_1.0.4_1756656219470_0.19393347433087516"},"_hasShrinkwrap":false}},"time":{"created":"2025-08-31T15:57:07.124Z","modified":"2025-08-31T16:03:39.849Z","1.0.1":"2025-08-31T13:19:58.115Z","1.0.2":"2025-08-31T15:57:07.411Z","1.0.3":"2025-08-31T15:59:05.415Z","1.0.4":"2025-08-31T16:03:39.682Z"},"bugs":{"url":"https://github.com/dhanrajsingh16/Uploadnest-npm.git"},"author":{"name":"Dhanraj Singh"},"license":"Apache-2.0","homepage":"https://github.com/dhanrajsingh16/Uploadnest-npm","keywords":["uploadnest","file-upload","storage","typescript","nodejs","nextjs"],"repository":{"url":"git+https://github.com/dhanrajsingh16/Uploadnest-npm.git"},"description":"The official TypeScript library for the Uploadnest API","maintainers":[{"name":"dhanraj16","email":"dhanrajsingh1512@gmail.com"}],"readme":"# @dhanraj16/uploadnest-sdk\n\n[![NPM version](https://img.shields.io/npm/v/@dhanraj16/uploadnest-sdk.svg)]\n\nTypeScript library for uploading files to Uploadnest API. Works in Node.js, Next.js, and browsers.\n\n## Installation\nnpm install @dhanraj16/uploadnest-sdk\n# or\npnpm add @dhanraj16/uploadnest-sdk\n\n## Quick Start\n\n# typescript\n\nimport { UploadNestClient } from \"@dhanraj16/uploadnest-sdk\";\n\nconst client = new UploadNestClient({\n  apiKey: \"your-api-key\",\n});\n\n// Upload files\nconst result = await client.uploadFiles(files);\nconsole.log(result.files);\n\n\n## Usage Examples\n\n### Node.js - File Paths\n\n### typescript\n\n// Upload from file path\nawait client.uploadFiles(\"/path/to/file.jpg\");\n\n// Multiple files\nawait client.uploadFiles([\"/path/to/file1.jpg\", \"/path/to/file2.pdf\"]);\n\n\n### Node.js - Buffers\n\n# typescript\nimport fs from \"fs\";\n\nconst buffer = fs.readFileSync(\"image.jpg\");\n// Add metadata to buffer\nbuffer.name = \"image.jpg\";\nbuffer.type = \"image/jpeg\";\n\nawait client.uploadFiles(buffer);\n\n\n### Browser/Next.js - File Objects\n\n# typescript\n// From file input\nconst fileInput = document.querySelector('input[type=\"file\"]');\nawait client.uploadFiles(fileInput.files[0]);\n\n// Multiple files\nawait client.uploadFiles(Array.from(fileInput.files));\n\n\n### Next.js Server Actions\n\n# typescript\n// app/upload/page.tsx\nimport { UploadNestClient } from \"@dhanraj16/uploadnest-sdk\";\n\nasync function uploadAction(formData: FormData) {\n  \"use server\";\n\n  const client = new UploadNestClient({\n    apiKey: process.env.UPLOADNEST_API_KEY!,\n    isBrowser: true,\n  });\n\n  const file = formData.get(\"file\") as File;\n  const result = await client.uploadFiles(file);\n\n  return result;\n}\n\n\n## Supported File Types\n\n- **Node.js**: File paths (strings), Buffers\n- **Browser**: File objects, Blob objects\n- **Next.js**: File objects, Blob objects (server actions/API routes)\n\n## Error Handling\n\n# typescript\nimport { ValidationError, UploadError } from \"@dhanraj16/uploadnest-sdk/errors\";\n\ntry {\n  await client.uploadFiles(files);\n} catch (error) {\n  if (error instanceof ValidationError) {\n    console.log(\"Invalid file type:\", error.message);\n  } else if (error instanceof UploadError) {\n    console.log(\"Upload failed:\", error.message);\n  }\n}\n\n\n## TypeScript Support\n\nFull TypeScript support with type definitions:\n\n# typescript\nimport type { UploadFileResponse } from \"@dhanraj16/uploadnest-sdk/types\";\n\nconst result: UploadFileResponse = await client.uploadFiles(files);\n\n\n## Requirements\n\n- **Node.js**: 18+\n- **TypeScript**: 4.5+ (optional)\n- **Browsers**: Modern browsers with fetch support\n- **Next.js**: 13+ (App Router recommended)\n\n## License\n\nApache-2.0\n\n\n## Contributing\n\nContributions are welcome! Please read the guidelines on how to contribute to this project.\n\n\n\n","readmeFilename":"README.md"}