diff --git a/README.md b/README.md index 522fbc9..d1391f5 100644 --- a/README.md +++ b/README.md @@ -11,47 +11,37 @@ ## Installation -Node.js: +via npm: ```shell -npm install jquery-param --save -``` - -the browser: - -```html - +npm i jquery-param ``` ## Usage -CommonJS: - ```javascript -const param = require('jquery-param'); +import param from 'jquery-param'; const obj = { key1: { value1: [10, 20, 30] }, key2: '?a=b&c=d' }; const str = param(obj); // => "key1[value1][]=10&key1[value1][]=20&key1[value1][]=30&key2=?a=b&c=d" ``` -TypeScript: +CommonJS: ```javascript -import param from 'jquery-param'; +const param = require('jquery-param'); const obj = { key1: { value1: [10, 20, 30] }, key2: '?a=b&c=d' }; const str = param(obj); // => "key1[value1][]=10&key1[value1][]=20&key1[value1][]=30&key2=?a=b&c=d" ``` -*You will need to add `"esModuleInterop": true` to the `"compilerOptions"` field in `tsconfig.json`.* - -ES Modules: +ES Modules (Browser): ```html ``` -Older browser: +Traditional (Browser): ```html + ```