Comparing version 12.1.0 to 12.1.1
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -26,7 +30,7 @@ if (k2 === undefined) k2 = k; | ||
*/ | ||
exports.middleware = popsicle_transport_xhr_1.transport(); | ||
exports.middleware = (0, popsicle_transport_xhr_1.transport)(); | ||
/** | ||
* Standard browser fetch interface. | ||
*/ | ||
exports.fetch = common_1.toFetch(exports.middleware, browser_1.Request); | ||
exports.fetch = (0, common_1.toFetch)(exports.middleware, browser_1.Request); | ||
//# sourceMappingURL=browser.js.map |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const vitest_1 = require("vitest"); | ||
const index_1 = require("./index"); | ||
describe("popsicle", () => { | ||
it("should export a fetch and middleware function", () => { | ||
expect(index_1.fetch).toBeInstanceOf(Function); | ||
expect(index_1.middleware).toBeInstanceOf(Function); | ||
(0, vitest_1.describe)("popsicle", () => { | ||
(0, vitest_1.it)("should export a fetch and middleware function", () => { | ||
(0, vitest_1.expect)(index_1.fetch).toBeInstanceOf(Function); | ||
(0, vitest_1.expect)(index_1.middleware).toBeInstanceOf(Function); | ||
}); | ||
}); | ||
//# sourceMappingURL=index.spec.js.map |
@@ -13,3 +13,3 @@ import { Request } from "servie/dist/node"; | ||
*/ | ||
export { contentEncoding, cookies, HttpResponse, redirects, Request, transport, userAgent }; | ||
export { contentEncoding, cookies, HttpResponse, redirects, Request, transport, userAgent, }; | ||
/** | ||
@@ -16,0 +16,0 @@ * Node.js standard middleware stack. |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -35,7 +39,7 @@ if (k2 === undefined) k2 = k; | ||
*/ | ||
exports.middleware = throwback_1.compose([ | ||
popsicle_user_agent_1.userAgent(), | ||
popsicle_content_encoding_1.contentEncoding(), | ||
exports.middleware = (0, throwback_1.compose)([ | ||
(0, popsicle_user_agent_1.userAgent)(), | ||
(0, popsicle_content_encoding_1.contentEncoding)(), | ||
// Redirects must happen around cookie support. | ||
popsicle_redirects_1.redirects(throwback_1.compose([popsicle_cookie_jar_1.cookies(), popsicle_transport_http_1.transport()])) | ||
(0, popsicle_redirects_1.redirects)((0, throwback_1.compose)([(0, popsicle_cookie_jar_1.cookies)(), (0, popsicle_transport_http_1.transport)()])), | ||
]); | ||
@@ -45,3 +49,3 @@ /** | ||
*/ | ||
exports.fetch = common_1.toFetch(exports.middleware, node_1.Request); | ||
exports.fetch = (0, common_1.toFetch)(exports.middleware, node_1.Request); | ||
//# sourceMappingURL=node.js.map |
134
package.json
{ | ||
"name": "popsicle", | ||
"version": "12.1.0", | ||
"version": "12.1.1", | ||
"description": "Advanced HTTP requests in node.js and browsers", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"files": [ | ||
"dist/", | ||
"logo.svg" | ||
], | ||
"browser": { | ||
"./dist/node.js": "./dist/browser.js" | ||
}, | ||
"scripts": { | ||
"prettier": "prettier --write", | ||
"lint": "tslint \"{.,src/**}/*.{js,jsx,ts,tsx}\" --project tsconfig.json", | ||
"format": "npm run prettier -- \"{.,src/**}/*.{js,jsx,ts,tsx,md,yml,yaml}\"", | ||
"build": "rimraf dist && tsc", | ||
"specs": "jest --coverage", | ||
"test": "npm run -s lint && npm run -s build && npm run -s specs && npm run -s size", | ||
"prepare": "npm run build", | ||
"size": "size-limit" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/serviejs/popsicle.git" | ||
}, | ||
"keywords": [ | ||
@@ -37,2 +14,11 @@ "request", | ||
], | ||
"homepage": "https://github.com/serviejs/popsicle", | ||
"bugs": { | ||
"url": "https://github.com/serviejs/popsicle/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/serviejs/popsicle.git" | ||
}, | ||
"license": "MIT", | ||
"author": { | ||
@@ -43,66 +29,24 @@ "name": "Blake Embrey", | ||
}, | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/serviejs/popsicle/issues" | ||
"main": "dist/index.js", | ||
"browser": { | ||
"./dist/node.js": "./dist/browser.js" | ||
}, | ||
"homepage": "https://github.com/serviejs/popsicle", | ||
"jest": { | ||
"roots": [ | ||
"<rootDir>/src/" | ||
], | ||
"transform": { | ||
"\\.tsx?$": "ts-jest" | ||
}, | ||
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(tsx?|jsx?)$", | ||
"moduleFileExtensions": [ | ||
"ts", | ||
"tsx", | ||
"js", | ||
"jsx", | ||
"json", | ||
"node" | ||
] | ||
}, | ||
"size-limit": [ | ||
{ | ||
"path": "./dist/index.js", | ||
"limit": "3.1 kB" | ||
} | ||
"types": "dist/index.d.ts", | ||
"files": [ | ||
"dist/", | ||
"logo.svg" | ||
], | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "lint-staged" | ||
} | ||
"scripts": { | ||
"build": "ts-scripts build", | ||
"format": "ts-scripts format", | ||
"prepare": "ts-scripts install", | ||
"prepublishOnly": "npm run build", | ||
"size": "size-limit", | ||
"specs": "ts-scripts specs", | ||
"test": "ts-scripts test && npm run size" | ||
}, | ||
"lint-staged": { | ||
"*.{js,jsx,ts,tsx,json,css,md,yml,yaml}": [ | ||
"npm run prettier", | ||
"git add" | ||
] | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"devDependencies": { | ||
"@size-limit/preset-small-lib": "^4.6.0", | ||
"@types/jest": "^26.0.14", | ||
"@types/node": "^14.11.5", | ||
"browserify": "^16.2.3", | ||
"husky": "^4.3.0", | ||
"jest": "^26.5.2", | ||
"lint-staged": "^10.4.0", | ||
"prettier": "^2.1.2", | ||
"rimraf": "^3.0.0", | ||
"size-limit": "^4.6.0", | ||
"ts-jest": "^26.4.1", | ||
"tslint": "^6.1.3", | ||
"tslint-config-prettier": "^1.18.0", | ||
"tslint-config-standard": "^9.0.0", | ||
"typescript": "^4.0.3" | ||
}, | ||
"dependencies": { | ||
"popsicle-content-encoding": "^1.0.0", | ||
"popsicle-cookie-jar": "^1.0.0", | ||
"popsicle-redirects": "^1.1.0", | ||
"popsicle-transport-http": "^1.0.8", | ||
"popsicle-transport-http": "^1.1.0", | ||
"popsicle-transport-xhr": "^2.0.0", | ||
@@ -112,3 +56,25 @@ "popsicle-user-agent": "^1.0.0", | ||
"throwback": "^4.1.0" | ||
} | ||
} | ||
}, | ||
"devDependencies": { | ||
"@borderless/ts-scripts": "^0.15.0", | ||
"@size-limit/preset-small-lib": "^11.0.0", | ||
"@types/node": "^20.9.3", | ||
"@vitest/coverage-v8": "^0.34.6", | ||
"popsicle-cookie-jar": "^1.0.1", | ||
"size-limit": "^11.0.0", | ||
"typescript": "^5.3.2", | ||
"vitest": "^0.34.6" | ||
}, | ||
"engines": { | ||
"node": ">=8" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"size-limit": [ | ||
{ | ||
"path": "./dist/index.js", | ||
"limit": "3.3 kB" | ||
} | ||
] | ||
} |
@@ -38,6 +38,7 @@ # ![Popsicle](logo.svg) | ||
- Default `User-Agent` | ||
- Support for decoding compressed payloads | ||
- Follows HTTP redirects | ||
- Caches cookies in-memory | ||
- Default `User-Agent` ([Learn more](https://github.com/serviejs/popsicle-user-agent)) | ||
- Decodes `gzip`, `deflate` and `brotli` ([Learn more](https://github.com/serviejs/popsicle-content-encoding)) | ||
- Follows HTTP redirects ([Learn more](https://github.com/serviejs/popsicle-redirects)) | ||
- In-memory cookie cache ([Learn more](https://github.com/serviejs/popsicle-cookie-jar)) | ||
- Automatic HTTP2 and HTTP1 support and DNS caching ([Learn more](https://github.com/serviejs/popsicle-transport-http)) | ||
@@ -58,3 +59,3 @@ > **Important:** If you are doing anything non-trivial with Popsicle, please override the `User-Agent` and respect `robots.txt`. | ||
const res = fetch("http://example.com", { | ||
signal: controller.signal | ||
signal: controller.signal, | ||
}); | ||
@@ -90,3 +91,3 @@ ``` | ||
req: Request, | ||
next: () => Promise<Response> | ||
next: () => Promise<Response>, | ||
) => Promise<Response>; | ||
@@ -93,0 +94,0 @@ ``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23022
7
8
185
106
- Removedpopsicle-cookie-jar@^1.0.0
- Removed@types/tough-cookie@4.0.5(transitive)
- Removedpopsicle-cookie-jar@1.0.1(transitive)
- Removedpsl@1.10.0(transitive)
- Removedpunycode@2.3.1(transitive)
- Removedquerystringify@2.2.0(transitive)
- Removedrequires-port@1.0.0(transitive)
- Removedtough-cookie@4.1.4(transitive)
- Removeduniversalify@0.2.0(transitive)
- Removedurl-parse@1.5.10(transitive)