Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
@es-git/core
Advanced tools
This is part of the ES-Git project.
npm install --save @es-git/core
This package contains a lot of core functionality used by most of the other es-git packagase. You probably don't need to use this package directly
This interface is the core of all es-git repositories. New repositories should implement this interface, and mixins should be applied, either directly or indirectly, to this interface.
export interface IRawRepo {
listRefs() : Promise<string[]>
getRef(ref : string) : Promise<Hash | undefined>
setRef(ref : string, hash : Hash | undefined) : Promise<void>
saveRaw(hash : Hash, object : Uint8Array) : Promise<void>
loadRaw(hash : Hash) : Promise<Uint8Array | undefined>
hasObject(hash : Hash) : Promise<boolean>
saveMetadata(name : string, value : Uint8Array | undefined) : Promise<void>
loadMetadata(name : string) : Promise<Uint8Array | undefined>
}
export type Hash = string;
listRefs() : Promise<string[]>
Resolves a list of refs (branches and tags). This resolves the full name, for example refs/heads/master
or refs/tags/v1.2.3
.
getRef(ref : string) : Promise<string | undefined>
Resolves the hash that the ref points to, if it exists. If the ref does not exist, resolves undefined
.
setRef(ref : string, hash : Hash | undefined) : Promise<void>
Set the ref to point to a hash. If the hash is undefined
, delete the ref. The full name of the ref should be used, for example refs/heads/master
or refs/tags/v1.2.3
.
saveRaw(hash : Hash, object : Uint8Array) : Promise<void>
Save a git object with the hash.
loadRaw(hash : Hash) : Promise<Uint8Array | undefined>
Load a git object defined by the hash. If the object does not exist, undefined
is resolved.
hasObject(hash : Hash) : Promise<boolean>
Resolves to true
if the object exists in the repo, otherwise false
.
saveMetadata(name : string, value : Uint8Array | undefined) : Promise<void>
Save metadata about the repository. If the value is undefined
, the metadata is deleted.
loadMetadata(name : string) : Promise<Uint8Array | undefined>
Load metadata about the repository. If the metadata does not exist, resolves undefined
.
FAQs
This is part of the [ES-Git](https://github.com/es-git/es-git) project.
The npm package @es-git/core receives a total of 31 weekly downloads. As such, @es-git/core popularity was classified as not popular.
We found that @es-git/core 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
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.