
Security News
npm ‘is’ Package Hijacked in Expanding Supply Chain Attack
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
@dorsi/remarkable-typescript
Advanced tools
This project was inspired by the work of https://github.com/kevlened/remarkable-node, adding typing and new features like the upload of a document.
Unofficial reMarkable api wrapper for node.js based on these unofficial docs. This module is typed for TypeScript, but you can still use JavaScript with it.
yarn add remarkable-typescript
# OR
npm install remarkable-typescript
Then, go to reMarkable's website to genereate a code to pair your reMarkable. This code is only available 5 minutes.
import { Remarkable, ItemResponse } from 'remarkable-typescript';
// const { Remarkable, ItemResponse } = require('remarkable-typescript');
const fs = require('fs');
(async () => {
/*
* Create the reMarkable client
* Params: { deviceToken?: string }
* Returns: client: Remarkable
*/
const client = new Remarkable();
/*
* Register your reMarkable and generate a device token. You must do this first to pair your device if you didn't specify a token. This may take a few seconds to complete. It seems that the deviceToken never expires.
* Params: { code: string }
* Returns: deviceToken: string
*/
const deviceToken = await client.register({ code: 'created code' });
// (optional) skip registration in the future with `new Remarkable({deviceToken})`
console.log(deviceToken);
/*
* (Re)generate a token from the deviceToken. You MUST call this function after creating the client. This token, used to interact with storage, is different from the deviceToken. This function is automatically called in register(). This token expires.
* Params: none
* Returns: token: string
*/
await client.refreshToken();
/*
* List all items, files and folders.
* Params: none
* Returns: ItemResponse[]
*/
const items = await client.getAllItems();
/*
* Get an item by id
* Params: id: string
* Returns: ItemResponse | null
*/
const item = await client.getItemWithId('some uuid');
/*
* Delete an item by is ID and document version
* Params: id: string, version: number
* Returns: success: boolean
*/
await client.deleteItem('some uuid', 1);
const myPDF = fs.readFileSync('./my/PDF/location.pdf');
/*
* Upload a PDF to your reMarkable
* Params: name: string, file: Buffer
* Returns: id: string
*/
const pdfUploadedId = await client.uploadPDF('My PDF name', myPDF);
/*
* Download a ZIP file to your reMarkable (with the annotations)
* Params: id: string
* Returns: Buffer
*/
const zipFile = await client.downloadZip(pdfUploadedId);
/*
* Upload a ZIP file to your reMarkable (must be a supported reMarkable format). You can generate the ID using uuidv4.
* Params: name: string, id: string, zipFile: Buffer
* Returns: id: string
*/
const zipFileId = await client.uploadZip('My document name', ID: 'f831481c-7d2d-4776-922d-36e708d9d680', zipFile);
/*
* Upload an ePub file to your reMarkable (must be a supported reMarkable format). You can generate the ID using uuidv4 or v5. v5 will deterministically generate a uuid based on name and namespace .
* Params: name: string, id: string, epubFileBuffer: Buffer, parent?: string
* Returns: id: string
*/
const epubDocId = await client.uploadEPUB('name of ePub document', ID: '181a124b-bbdf-4fdd-8310-64fa87bc9c7f', epubFileBuffer, /*optional UUID of parent folder*/);
/*
* Create a directory
* Params: name: string, id: string, epubFileBuffer: Buffer, parent?: string
* Returns: id: string
*/
const directoryId = await client.createDirectory('testDir2', id, ID: '702ba145-0a78-4e19-9324-6f8fb3da3c1a', /*optional UUID of parent folder*/);
})();
MIT
FAQs
A typescript reMarkable Cloud API
The npm package @dorsi/remarkable-typescript receives a total of 0 weekly downloads. As such, @dorsi/remarkable-typescript popularity was classified as not popular.
We found that @dorsi/remarkable-typescript 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
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
Security News
A critical flaw in the popular npm form-data package could allow HTTP parameter pollution, affecting millions of projects until patched versions are adopted.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.