
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@godprotocol/repositories
Advanced tools
Repository management module for the God Protocol network. Handles storage, sync, and access layers for Oracle nodes and clients.
A unified interface for managing local and remote repositories.
This module provides a common abstraction for file operations across storage layers like the filesystem, GitHub, and other distributed repositories, forming the backbone of the God Protocol’s decentralized data infrastructure.
Repository class.Repos manager dynamically instantiates repositories from definitions.Install the module using npm:
npm install @godprotocol/repositories
Set up and use a repository with the following example:
import Repos from "@godprotocol/repositories/index.js";
const repoDef = {
type: "github",
options: {
key: "ghp_XXXXX",
username: "user-name",
repo: "godprotocol-repos",
branch: "main",
},
};
const repositories = new Repos();
const repo = await repositories.cloth_repo(repoDef);
// Write file
await repo.write("docs/readme.md", "# Hello World");
// Read file
const content = await repo.read("docs/readme.md");
console.log(content); // "# Hello World"
// Sync repository
await repo.sync();
Repository| Method | Description |
|---|---|
constructor(type) | Initializes a repository instance with its type (e.g., fs, github). |
sync() | Synchronizes repository state. |
write(path, content) | Writes data to the repository at the given path. |
read(path) | Reads content from the repository. |
objectify() | Returns an object representation of the repository configuration. |
get_id() | Returns the unique identifier of the repository. |
match() | Checks if the repository matches a given query or condition. |
Repos| Method | Description |
|---|---|
cloth_repo(repoDef) | Dynamically instantiates a repository based on its type and options. |
Example:
const repos = new Repos();
const repo = await repos.cloth_repo({
type: "fs",
options: { root: "./data" },
});
Implements file operations over the GitHub REST API using fetch.
import Repository from "@godprotocol/repositories/Repository.js";
class Github extends Repository {
constructor({ key, username, repo, branch }) {
super("github");
this.auth_token = key;
this.owner = username;
this.repo = repo;
this.branch = branch || "main";
}
async write_file(file_path, content) {
// Handles create/update file logic with SHA conflict resolution
}
async read_file(file_path) {
// Reads and decodes Base64 content from GitHub
}
async delete_file(file_path) {
// Deletes file via GitHub API
}
repo_id = () => `string`;
}
| Type | Description | Example Configuration |
|---|---|---|
fs | Local filesystem repository | { type: "fs", options: { root: "./data" } } |
github | Remote GitHub-based repository | { type: "github", options: { key, username, repo } } |
To add a custom repository type, extend the Repository class and implement the required I/O methods (write_file, read_file, etc.).
This package is natively integrated into the God Protocol ecosystem:
| Module | Purpose |
|---|---|
@godprotocol/oracle | Uses repositories as data mirrors and sync points. |
generalised-datastore | Leverages repositories for distributed CRUD storage. |
godprotocol | Core orchestrator for repository coordination and transactions. |
Create a custom repository driver by extending the Repository class:
import Repository from "@godprotocol/repositories/Repository.js";
class MyCustomRepo extends Repository {
constructor(options) {
super("custom");
this.options = options;
}
async write_file(path, content) {
// Implement custom write logic
}
async read_file(path) {
// Implement custom read logic
}
}
Register the custom repository dynamically:
const repos = new Repos();
const myRepo = await repos.cloth_repo({ type: "custom", options: { ... } });
MIT © Savvy
FAQs
Repository management module for the God Protocol network. Handles storage, sync, and access layers for Oracle nodes and clients.
We found that @godprotocol/repositories 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.