
Product
Introducing Repository Access Permissions and Custom Roles
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.
@inferagraph/file-datasource
Advanced tools
File datasource for InferaGraph (CSV, TSV, Markdown folders)
File-based datasource plugin for @inferagraph/core. Loads nodes from delimited files (CSV/TSV) or a folder of Markdown files with frontmatter.
pnpm add @inferagraph/file-datasource @inferagraph/core
import { FileDatasource } from '@inferagraph/file-datasource';
const datasource = new FileDatasource({
type: 'csv',
path: './data/nodes.csv',
hasHeader: true, // first row contains column names
contentFields: ['summary'], // optional: surface columns via getContent
edges: [
{
id: 'e1',
sourceId: 'n1',
targetId: 'n2',
attributes: { type: 'related_to' },
},
],
});
await datasource.connect();
const view = await datasource.getInitialView();
const node = await datasource.getNode('n1');
const neighbors = await datasource.getNeighbors('n1');
const results = await datasource.search('keyword');
await datasource.disconnect();
import { FileDatasource } from '@inferagraph/file-datasource';
const datasource = new FileDatasource({
type: 'markdown',
path: './data/nodes', // folder containing .md files
frontmatter: ['id', 'name', 'type'], // required keys per file (exact match)
edges: [],
});
await datasource.connect();
// Each .md file becomes a node with frontmatter as attributes;
// the body is exposed via getContent.
const content = await datasource.getContent('n1');
// { nodeId: 'n1', content: '<body markdown>', contentType: 'markdown' }
| Option | Type | Description |
|---|---|---|
type | 'csv' | 'tsv' | 'markdown' | File format |
path | string | File path (csv/tsv) or folder path (markdown) |
edges | EdgeData[] | Host-supplied relationships |
idField | string | Column / frontmatter key for the node id (default: 'id') |
| Option | Type | Description |
|---|---|---|
hasHeader | boolean | First row is column names (default: true) |
columns | string[] | Required when hasHeader=false. Length must match the parsed first row. |
contentFields | string[] | Columns surfaced via getContent as metadata. When unset, getContent returns undefined. |
| Option | Type | Description |
|---|---|---|
frontmatter | string[] | Required keys. Each .md file must contain EXACTLY this set (extras and missing keys throw). |
connect() reads and parses every file up-front (deterministic, fail-fast).disconnect() clears the parsed state.DataAdapter methods (getInitialView, getNode, getNeighbors, findPath, search, filter, getContent) require an active connection.config.edges are stored as-is and used for graph traversal.MIT
FAQs
File datasource for InferaGraph (CSV, TSV, Markdown folders)
We found that @inferagraph/file-datasource 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.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.

Product
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.