diff --git a/README.md b/README.md index bd467f7..48675dd 100644 --- a/README.md +++ b/README.md @@ -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). @@ -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? @@ -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')()) } ``` @@ -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) { @@ -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) { @@ -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) { @@ -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) { diff --git a/index.js b/index.js index 7ac8563..8a6d2e6 100644 --- a/index.js +++ b/index.js @@ -64,5 +64,5 @@ function middiePlugin (fastify, options, next) { module.exports = fp(middiePlugin, { fastify: '4.x', - name: 'middie' + name: '@fastify/middie' }) diff --git a/package.json b/package.json index 5a01015..3834834 100644 --- a/package.json +++ b/package.json @@ -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", @@ -51,5 +51,8 @@ }, "tsd": { "directory": "test" + }, + "publishConfig": { + "access": "public" } }