
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
contentful-config
Advanced tools
Fetching JSON from Contentful to use the same configs across multiple projects and repositories.
Fetching JSON from Contentful to use the same configs across multiple projects and repositories.
Install using npm as devDependency.
$ npm install contentful-config --save-dev
Add a command to the scripts of package.json.
"scripts": {
"serve": "npm run config"
"config": "contentful-config"
},
Environment variables are automatically loaded by creating .env in the same directory as package.json. You can also use an existing environment variable without using .env.
CONTENTFUL_SPACE_ID=up61khjnndzm
CONTENTFUL_ACCESS_TOKEN=FeBoFnhmElUGRC76v-2T6DxOHhhhhg9FyiwWVxVs148
CONTENTFUL_CONFIG_ENV=local
You can also apply parameters when command execution without creating .env.
Create a file as .cntconfigrc.json as in the following code:
{
"local": {
"dir": "./configs",
"models": [
{
"name": "env",
"options": {
"order": "fields.type",
"fields.type": "local"
},
"specificField": "json",
"firstOnly": true,
"filterUseFields": [
"contentful.endpoint"
]
},
{
"name": "resources",
"options": {
"order": "fields.type"
}
}
]
},
"dev": {
"dir": "./configs",
"models": [
{
"name": "env",
"options": {
"order": "fields.type",
"fields.type": "dev"
},
"specificField": "json",
"firstOnly": true
}
]
}
}
| Parameter | Description | Default | | ---- | ---- | ---- | --- | | * | The environment specified by the command execution or environment variable is selected. | '' | | *.dir | Destination of the config file. | '' | | *.models | Contentful models objects. | | | *.models.name | Output Contentful model name. This model name will be the file name. | | | *.models.options | See search-parameters in Contentful's getEntries. https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters/links-to-asset | {} | | *.models.specificField | Specify this if you want data only for fields in the model. | '' | | *.models.firstOnly | Fetch only a single from an array. (it becomes an object type) | false | | *.models.filterUseFields | Fetch only the specified parameters from the objects in the array after specificField parameter. | undefind |
Add the destination directory of the config file to .gitignore.
configs/
Execute the following command in the same directory as the configuration file.
$ npm run config
$ npm run config -- dev --spaceId up61khjnndzm --accessToken FeBoFnhmElUGRC76v-2T6DxOHhhhhg9FyiwWVxVs148
See tasks on Github Projects
npm install && npm run test
FAQs
Fetching JSON from Contentful to use the same configs across multiple projects and repositories.
The npm package contentful-config receives a total of 0 weekly downloads. As such, contentful-config popularity was classified as not popular.
We found that contentful-config demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.