entrymd
v1.0.19
Published
Node.js API wrapper for [Entry](https://codeberg.org/hkau/entry) instances.
Downloads
2
Readme
entrymd
Node.js API wrapper for Entry instances.
Implements API as described here. Does not implemenet admin endpoints.
Install
npm install entrymd
Usage
new Entry("https://sentrytwo.com");
The constructor takes a server
input, which determines which server to send requests to. Uses https://sentrytwo.com
as the default.
Create Paste
Create a new paste with the specified content.
- props:
Content
: string, the content of the pasteCustomURL
: string, the path the paste will be saved atEditPassword
: string, the password used to edit the pasteIsEditable
?: boolean, determines if the paste should be editable (true
by default)ViewPassword
?: string, encrypts paste if providedExpireOn
?: string, exact date and time to delete paste onGroupName
?: string, group name (required ifGroupSubmitPassword
is provided)GroupSumbmitPassword
?: string, group password (required ifGroupName
is provided)
const client = new Entry();
await client.NewPaste({
Content: "test paste",
CustomURL: "test",
EditPassword: "12345",
IsEditable: true,
ViewPassword: "12345",
ExpireOn: new Date().toUTCString(),
GroupName: "test",
GroupSubmitPassword: "12345",
});
Edit Paste
Edit an existing paste.
- props:
Content
: string, the new content of the pasteCustomURL
: string, the path the paste is saved atEditPassword
: string, the paste edit passwordNewEditPassword
?: string, the password to change the paste edit password to (password does not change if this is not provided)NewCustomURL
?: string, the path to change the paste path to (path does not change if this is not provided)
const client = new Entry();
await client.EditPaste({
Content: "test 1",
CustomURL: "test",
EditPassword: "12345",
NewEditPassword: "54321",
NewCustomURL: "test1",
});
Delete Paste
Delete an existing paste.
- props:
CustomURL
: string, the path the paste is saved atEditPassword
: string, the paste edit password
const client = new Entry();
await client.DeletePaste({
CustomURL: "test1",
EditPassword: "54321",
});
Get Paste
Get an existing paste.
CustomURL
: string, the path the paste is saved at
const client = new Entry();
await client.GetPaste("example");
Decrypt Paste
Decrypt a private paste.
- props:
CustomURL
: string, the path the paste is saved atViewPassword
: string, the paste view password
const client = new Entry();
await client.GetPaste({
CustomURL: "test",
ViewPassword: "12345",
});
Development
Requires Bun
- Clone repository (
git clone https://codeberg.org/hkau/entry
) - cd into directory (
cd packages/api
) - Install dependencies (
bun i
) - Format (
bun run format
) - Build (
bun run build
)