
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
@contentrain/core
Advanced tools
Core functionality for Contentrain SDK.
npm install @contentrain/core
import { ContentrainCore } from '@contentrain/core'
// Initialize with default configuration
const core = new ContentrainCore()
// Initialize with custom configuration
const customCore = new ContentrainCore({
contentPath: 'custom/content/path',
modelsPath: 'custom/models/path',
locale: 'en'
})
// Get model metadata
const metadata = await core.getModelMetadata('posts')
// Get content
const posts = await core.getContent('posts')
// Get content by ID
const post = await core.getContentById('posts', '123')
// Get available collections
const collections = await core.getAvailableCollections()
constructor(config?: ContentrainConfig, customFs?: ContentrainFileSystem)
Creates a new instance of ContentrainCore.
config
(optional): Configuration object
contentPath
: Path to content directory (default: 'contentrain')modelsPath
: Path to models directory (default: 'contentrain/models')assetsPath
: Path to assets directory (default: 'contentrain/assets')locale
: Locale for content (default: undefined)customFs
(optional): Custom filesystem implementation
getModelMetadata(collection: string): Promise<ContentrainModelMetadata>
Gets metadata for a specific collection.
getContent<T>(collection: string): Promise<T[]>
Gets all content items from a collection.
getContentById<T>(collection: string, id: string): Promise<T>
Gets a specific content item by ID.
getAvailableCollections(): Promise<string[]>
Gets a list of all available collections.
getLocale(): string | undefined
Gets the current locale setting.
MIT
FAQs
Core functionality for Contentrain SDK.
The npm package @contentrain/core receives a total of 0 weekly downloads. As such, @contentrain/core popularity was classified as not popular.
We found that @contentrain/core demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.