Skip to content

Commit

Permalink
Merge pull request #148 from fastify/rename-module
Browse files Browse the repository at this point in the history
Rename module
  • Loading branch information
RafaelGSS authored Jun 7, 2022
2 parents a7c83a4 + eeee8f7 commit c1f3722
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# middie

![CI](https://github.com/fastify/middie/workflows/CI/badge.svg)
[![NPM version](https://img.shields.io/npm/v/middie.svg?style=flat)](https://www.npmjs.com/package/middie)
[![NPM version](https://img.shields.io/npm/v/@fastify/middie.svg?style=flat)](https://www.npmjs.com/package/@fastify/middie)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://standardjs.com/)

*middie* is the plugin that adds middleware support on steroids to [Fastify](https://www.npmjs.com/package/fastify).
Expand All @@ -22,7 +22,7 @@ const Fastify = require('fastify')

async function build () {
const fastify = Fastify()
await fastify.register(require('middie'), {
await fastify.register(require('@fastify/middie'), {
hook: 'onRequest' // default
})
// do you know we also have cors support?
Expand All @@ -47,7 +47,7 @@ const fastify = require('fastify')()
fastify.register(subsystem)

async function subsystem (fastify, opts) {
await fastify.register(require('middie'))
await fastify.register(require('@fastify/middie'))
fastify.use(require('cors')())
}
```
Expand All @@ -57,7 +57,7 @@ async function subsystem (fastify, opts) {
const fastify = require('fastify')()

fastify
.register(require('middie'))
.register(require('@fastify/middie'))
.register(subsystem)

async function subsystem (fastify, opts) {
Expand All @@ -74,7 +74,7 @@ Take a look at the [Lifecycle](https://www.fastify.io/docs/latest/Reference/Life
const fastify = require('fastify')()

fastify
.register(require('middie'))
.register(require('@fastify/middie'))
.register(subsystem)

async function subsystem (fastify, opts) {
Expand All @@ -101,7 +101,7 @@ If you want to change the Fastify hook that the middleware will be attached to,
const fastify = require('fastify')()

fastify
.register(require('middie'), { hook: 'preHandler' })
.register(require('@fastify/middie'), { hook: 'preHandler' })
.register(subsystem)

async function subsystem (fastify, opts) {
Expand Down Expand Up @@ -134,7 +134,7 @@ const path = require('path')
const serveStatic = require('serve-static')

fastify
.register(require('middie'))
.register(require('@fastify/middie'))
.register(subsystem)

async function subsystem (fastify, opts) {
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@ function middiePlugin (fastify, options, next) {

module.exports = fp(middiePlugin, {
fastify: '4.x',
name: 'middie'
name: '@fastify/middie'
})
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "middie",
"version": "7.0.0",
"name": "@fastify/middie",
"version": "8.0.0",
"description": "Middleware engine for Fastify",
"main": "index.js",
"types": "index.d.ts",
Expand Down Expand Up @@ -51,5 +51,8 @@
},
"tsd": {
"directory": "test"
},
"publishConfig": {
"access": "public"
}
}

0 comments on commit c1f3722

Please sign in to comment.