Skip to content

Commit

Permalink
renamed to form-auto-content
Browse files Browse the repository at this point in the history
  • Loading branch information
Eomm committed May 2, 2020
1 parent 1e2b755 commit 4fd42b2
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .dependabot/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version: 1
update_configs:
- package_manager: "javascript"
directory: "/"
update_schedule: "daily"
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# form-method
# form-auto-content

[![Build Status](https://github.com/Eomm/form-method/workflows/ci/badge.svg)](https://github.com/Eomm/form-method/actions)
[![Build Status](https://github.com/Eomm/form-auto-content/workflows/ci/badge.svg)](https://github.com/Eomm/form-auto-content/actions)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)


Expand All @@ -9,7 +9,7 @@ Build a form payload without caring if it should be `application/x-www-form-urle
## Install

```
npm install form-method
npm install form-auto-content
```

## Usage
Expand All @@ -29,9 +29,9 @@ The module return a JSON like this:
### `x-www-form-urlencoded`

```js
const formMethod = require('form-method')
const formAutoContent = require('form-auto-content')

const myForm = formMethod({
const myForm = formAutoContent({
field1: 'value1',
field2: ['value2', 'value2.2'] // array are supported too!!
})
Expand All @@ -43,9 +43,9 @@ myForm.headers // JSON with the `content-type` field set
### `multipart/form-data`

```js
const formMethod = require('form-method')
const formAutoContent = require('form-auto-content')

const myForm = formMethod({
const myForm = formAutoContent({
field1: 'value1',
field2: ['value2', 'value2.2'], // array are supported too!!
myFile: fs.createReadStream('the-file.xml'),
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { Readable } = require('readable-stream') // to support node6

module.exports = function formMethod (json) {
if (!json || typeof json !== 'object') {
throw new Error('Input to form-method must be a json object')
throw new Error('Input must be a json object')
}
const form = new FormData()
const hasFile = Object.keys(json)
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "form-method",
"name": "form-auto-content",
"version": "1.0.0",
"description": "Build a form without headache",
"main": "index.js",
Expand All @@ -11,14 +11,14 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/Eomm/form-method.git"
"url": "git+https://github.com/Eomm/form-auto-content.git"
},
"engines": {
"node": ">=6"
},
"keywords": [
"form",
"form-method",
"form-auto-content",
"x-www-form-urlencoded",
"multipart",
"form-data",
Expand All @@ -28,9 +28,9 @@
"author": "Manuel Spigolon <[email protected]> (https://github.com/Eomm)",
"license": "MIT",
"bugs": {
"url": "https://github.com/Eomm/form-method/issues"
"url": "https://github.com/Eomm/form-auto-content/issues"
},
"homepage": "https://github.com/Eomm/form-method#readme",
"homepage": "https://github.com/Eomm/form-auto-content#readme",
"devDependencies": {
"light-my-request": "^3.7.4",
"multiparty": "^4.2.1",
Expand Down

0 comments on commit 4fd42b2

Please sign in to comment.