Skip to content

Commit 4721193

Browse files
authored
feat: add new codemods (#2412)
1 parent a3b3ae4 commit 4721193

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/content/pages/en/guide/migrating-5.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,12 @@ This check only applies to the part of the path that `send` evaluates. When you
270270

271271
#### How to update
272272

273+
You can automatically update your code by running the following command:
274+
275+
<PackageManagerCommand command="npx codemod@latest @expressjs/sendfile-options" />
276+
277+
Or you can update your code manually:
278+
273279
```diff
274280
app.get('/files/:name', (req, res) => {
275281
- res.sendFile(req.params.name, { hidden: true, from: '/uploads' });
@@ -327,6 +333,12 @@ Use the [`mime-types` package](https://github.com/jshttp/mime-types) to work wit
327333

328334
#### How to update
329335

336+
You can automatically update your code by running the following command:
337+
338+
<PackageManagerCommand command="npx codemod@latest @expressjs/static-mime" />
339+
340+
Or you can update your code manually:
341+
330342
```diff
331343
-express.static.mime.lookup('json');
332344
+const mime = require('mime-types');

0 commit comments

Comments
 (0)