From efe33f3de038fca71fc7fb74e11024ba384384bb Mon Sep 17 00:00:00 2001 From: Marcelo Lauxen Date: Wed, 2 Jun 2021 10:10:31 -0300 Subject: [PATCH] Update docs to match the new package name --- LICENSE | 2 +- README.md | 20 +++++++++----------- package.json | 6 +++--- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/LICENSE b/LICENSE index 95c451f..1a98e24 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 Marcelo Lauxen +Copyright (c) 2021 Basecamp Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 3318d95..833a105 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,16 @@ -# Rails Fetch +# Request.JS -Rails Fetch encapsulates the logic to send by default some headers that are required by rails applications like the `X-CSRF-Token`. +Request.JS encapsulates the logic to send by default some headers that are required by rails applications like the `X-CSRF-Token`. # Install ### npm ``` -npm i rails-fetch +npm i @rails/request.js ``` ### yarn ```shell -yarn add rails-fetch +yarn add @rails/request.js ``` # How to use @@ -20,12 +20,12 @@ Just import the `Request` class from the package and instantiate it passing the Example: ```js -import { Request } from 'rails-fetch' +import { Request } from '@rails/request.js' .... async myMethod () { - const request = new Request('post', 'localhost:3000/my_endpoint', { body: { name: 'Rails Fetch' }}) + const request = new Request('post', 'localhost:3000/my_endpoint', { body: { name: 'Request.JS' }}) const response = await request.perform() if (response.ok) { const body = await response.text @@ -35,10 +35,8 @@ async myMethod () { } ``` -# Credits - -[Basecamp](https://github.com/basecamp), since this piece of code has been extracted from hey.com. - # License -Rails Fetch is released under the [MIT License](LICENSE). \ No newline at end of file +Request.JS is released under the [MIT License](LICENSE). + +© 2021 Basecamp, LLC. \ No newline at end of file diff --git a/package.json b/package.json index de96ce1..c7fc0d0 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { - "name": "rails-fetch", + "name": "@rails/request.js", "version": "0.0.2", "description": "A tiny Fetch API wrapper that allows you to make http requests without need to handle to send the CSRF Token on every request", "main": "./src/index.js", "module": "./src/index.js", - "repository": "https://github.com/marcelolx/rails-fetch.git", + "repository": "https://github.com/rails/request.js", "author": "Marcelo Lauxen ", "license": "MIT", "private": false, @@ -15,7 +15,7 @@ "fetch api" ], "bugs": { - "url": "https://github.com/marcelolx/rails-fetch/issues" + "url": "https://github.com/rails/request.js" }, "scripts": { "lint": "standard src"