
Security News
Socket Releases Free Certified Patches for Critical vm2 Sandbox Escape
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.
@reignmodule/contentful-utils
Advanced tools
Sample:
import { ContentfulCache } from '@reignmodule/contentful-utils/contentful-cache'
const client = contentful.createClient()
const contentfulCache = new ContentfulCache({ client, fieldIndexable: ['slug'] });
// Get entries by field value
for await (const entry of contentfulCache.getEntriesByField('slug', ['/home', '/article/123', '/article/456'])) {
// ... do something with entry. Time 500ms
}
// Second time, we can get the entries from cache
for await (const entry of contentfulCache.getEntriesByField('slug', ['/home', '/article/123', '/article/456'])) {
// ... do something with entry. Time 10ms
}
Sample:
import { ContentfulCache } from '@reignmodule/contentful-utils/contentful-cache'
const client = contentful.createClient()
const contentfulCache = new ContentfulCache({ client, fieldIndexable: ['slug'] });
// Get entries by field value
for await (const entry of contentfulCache.getEntries({ content_type: 'articles', 'fields.type[in]': 'vip' })) {
// ... do something with entry. Time 500ms
}
Transform the get entries method to an async generator.
Example:
import { createPaginateItems } from '@reignmodule/contentful-utils/paginate-items'
const client = contentful.createClient()
const paginateItems = createPaginateItems(client.getEntries);
// Get all entries
for await (const entries of paginateItems()) {
// ... do something with entry
}
You can use the CONTENTFUL_CACHE_DEFAULT_TTL environment to set the default ttl for the cache. The default is 20 minutes and the format is ${number} ${Unit}
Unit can be
seconds,minutes,hours,days. Look the full list of units here: ms/index.ts#L9-L40
FAQs
### Get entries by field value
We found that @reignmodule/contentful-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.

Research
Five malicious NuGet packages impersonate Chinese .NET libraries to deploy a stealer targeting browser credentials, crypto wallets, SSH keys, and local files.

Security News
pnpm 11 turns on a 1-day Minimum Release Age and blocks exotic subdeps by default, adding safeguards against fast-moving supply chain attacks.