{"id":17847,"library":"nomine","title":"Nomine: Express Middleware for File Renaming","description":"Nomine is an Express.js middleware package that facilitates renaming files and folders through HTTP PUT requests. It provides a straightforward API to expose a file renaming endpoint within an Express application, which is typically used for administrative interfaces or content management systems that require remote file system manipulation. The current stable version is 4.0.0, which mandates Node.js version 10 or higher, continuing a pattern of dropping support for older Node.js versions in each major release. The package's release cadence is driven primarily by updates to its internal dependencies and adjustments to Node.js compatibility. Its main differentiator is its direct integration into the Express ecosystem, offering a pre-packaged solution for network-based file renaming operations, abstracting the underlying file system interactions by utilizing the `renamify` package for the core renaming logic.","status":"active","version":"4.0.0","language":"javascript","source_language":"en","source_url":"git://github.com/coderaiser/node-nomine","tags":["javascript","file","folder","rename","group","name"],"install":[{"cmd":"npm install nomine","lang":"bash","label":"npm"},{"cmd":"yarn add nomine","lang":"bash","label":"yarn"},{"cmd":"pnpm add nomine","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required to integrate `nomine` as middleware into an Express.js application.","package":"express","optional":false},{"reason":"Core dependency providing the actual file and folder renaming logic, used internally by `nomine`.","package":"renamify","optional":true}],"imports":[{"note":"Nomine primarily uses CommonJS `require` syntax. As of v4.0.0, there is no explicit ESM support documented or demonstrated.","wrong":"import nomine from 'nomine';","symbol":"nomine","correct":"const nomine = require('nomine');"},{"note":"The `nomine` function should be called to return the actual middleware, optionally with a `prefix` configuration object.","wrong":"app.use(nomine);","symbol":"MiddlewareUsage","correct":"app.use(nomine({ prefix: '/rename' }));"}],"quickstart":{"code":"const express = require('express');\nconst nomine = require('nomine');\nconst app = express();\n\n// Use nomine middleware with a custom prefix\napp.use(nomine({\n    prefix: '/files/rename' // default is '/rename'\n}));\n\napp.listen(3000, function () {\n    console.log('Nomine example app listening on port 3000!');\n    console.log('Send PUT requests to http://localhost:3000/files/rename');\n    console.log('Example curl: curl -X PUT -H \"Content-Type: application/json\" -d \\'{\"dir\":\"/tmp\",\"from\":[\"oldfile.txt\"], \"to\": [\"newfile.txt\"]}\\' http://localhost:3000/files/rename');\n});","lang":"javascript","description":"This quickstart initializes an Express server, integrates the `nomine` middleware, and listens on port 3000. It demonstrates how to configure a custom endpoint for rename operations and provides a `curl` example for testing."},"warnings":[{"fix":"Upgrade your Node.js environment to version 10 or higher before upgrading to nomine v4.0.0.","message":"Nomine v4.0.0 dropped support for Node.js versions older than 10. Applications running on Node.js 8 or earlier will not function correctly.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Upgrade your Node.js environment to version 8 or higher. For Node.js versions below 8, use nomine v2.x.","message":"Nomine v3.0.0 dropped support for Node.js versions older than 8.","severity":"breaking","affected_versions":">=3.0.0 <4.0.0"},{"fix":"Upgrade your Node.js environment to version 4 or higher. For Node.js versions below 4, use nomine v1.x.","message":"Nomine v2.0.0 dropped support for Node.js versions older than 4.","severity":"breaking","affected_versions":">=2.0.0 <3.0.0"},{"fix":"Always implement strong authentication (e.g., user sessions, API keys) and fine-grained authorization checks before using `nomine` in production. Restrict the `dir` parameter to only allow operations within designated user directories or safe zones.","message":"Exposing file system operations via HTTP, especially rename, presents significant security risks. Without robust authentication and authorization mechanisms in place, an attacker could rename critical system files.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-23T00:00:00.000Z","next_check":"2026-07-22T00:00:00.000Z","problems":[{"fix":"Ensure the Node.js process has appropriate file system permissions for the directories and files it attempts to modify. Avoid attempting to rename system-critical directories like `/bin` on production servers. Use relative paths or explicitly designated user data directories.","cause":"The Node.js process does not have sufficient permissions to perform file operations (read, write, rename) in the specified directory or on the target files.","error":"EACCES: permission denied, rename '/bin' -> '/bin2'"},{"fix":"Ensure `const nomine = require('nomine');` is at the top of your file and that `app.use(nomine({ /* options */ }));` is used, calling `nomine()` to get the middleware function.","cause":"The `nomine` package was not correctly imported or called as a function before being passed to `app.use()`, resulting in `undefined` instead of a middleware function.","error":"Error: Router.use() requires a middleware function but got a undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}