New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cors-extend

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cors-extend - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

23

package.json
{
"name": "cors-extend",
"version": "1.0.0",
"version": "1.0.1",
"description": "Configure the Cors Options with Ease",

@@ -15,3 +15,3 @@ "main": "dist/index.js",

"build:dev": " sudo npm link && cd ./testApp && npm link cors-extended && cd ../",
"test:coverage": "dotenv -v ENVIRONMENT=test jest --coverage --coverageReporters='text-summary' --watchAll",
"test:coverage": "dotenv -v ENVIRONMENT=test jest --coverage --coverageReporters='text-summary'",
"start:dev": "ts-node-dev ./src/index.ts",

@@ -33,3 +33,7 @@ "format": "prettier --write \"src/**\"",

},
"keywords": ["cors","environment","express"],
"keywords": [
"cors",
"environment",
"express"
],
"author": "Sankalpa Fernando",

@@ -39,6 +43,3 @@ "license": "MIT",

"cors": "^2.8.5",
"dotenv": "^16.0.0",
"dotenv-cli": "^5.0.0",
"express": "^4.17.3",
"lint-staged": "^12.3.5",
"lodash": "^4.17.21"

@@ -51,2 +52,6 @@ },

"@types/lodash": "^4.14.179",
"dotenv": "^16.0.0",
"dotenv-cli": "^5.0.0",
"jest": "^27.5.1",
"lint-staged": "^12.3.5",
"pre-commit": "^1.2.2",

@@ -61,4 +66,6 @@ "prettier": "^2.5.1",

"lint-staged": {
"*": [
"npm test"
],
"src/**": [
"npm test",
"npm run format",

@@ -70,3 +77,3 @@ "npm run lint",

},
"pre-commit": "lint-staged"
"pre-commit": "lint-staged -p false"
}

@@ -1,2 +0,2 @@

# cors-extend
# Cors-Extend

@@ -7,3 +7,3 @@ Cors-extend is a package which provides the configuration to the existing [Cors](http://www.senchalabs.org/connect/) nodejs package and which enables to configure cors according to the environments.

- [cors-extend](#cors-extend)
- [Cors-Extend](#cors-extend)
- [Installation](#installation)

@@ -25,21 +25,21 @@ - [Usage](#usage)

import cors from "cors";
import { corsextend } from "cors-extend";
import { corsExtend } from "cors-extend";
cors(
corsextend({
corsExtend({
env: {
development: {
origins: [
{
origin: "http://localhost:3000",
methods: ["GET"],
},
],
routes: [
{
endpoint: "/characters",
methods: ["GET", "POST"],
origins: ["http://localhost:5000"],
},
],
origins: [
{
origin: "http://localhost:3000",
methods: ["GET"],
},
],
routes: [
{
endpoint: "/characters",
methods: ["GET", "POST"],
origins: ["http://localhost:5000"],
},
],
},

@@ -56,3 +56,3 @@ },

Cors-extend is capable of loading specific configuration according to Environment variable, **ENVIRONMENT**. The variable can be pass either by dotenv cli, .env file or any other way.
Cors-Extend is capable of loading specific configuration according to Environment variable, **ENVIRONMENT**. The variable can be pass either by dotenv cli, .env file or any other way.

@@ -65,3 +65,3 @@ `Note` that both environment variable value and configuration name should be equal\*

```javascript
cors(corsextend({
cors(corsExtend({
env{

@@ -96,8 +96,8 @@ development:{

development: {
origins: [
{
origin: "http://localhost:3000",
methods: ["GET"],
},
];
origins: [
{
origin: "http://localhost:3000",
methods: ["GET"],
},
];
}

@@ -104,0 +104,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc