2.0.3 • Published 4 years ago

attheme-editor-api v2.0.3

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

attheme-editor-api

A little package for handling .attheme editor API.

Installing

npm i attheme-editor-api

Using

import * as atthemeEditorApi from "attheme-editor-api";

(async () => {
  const themeId = await atthemeEditorApi.uploadTheme({
    name: `Somewhere I Belong`,
    theme: `divider=#000000`,
  });

  const { name, theme } = await atthemeEditorApi.downloadTheme(themeId);

  console.log(name); // Somewhere I Belong
  console.log(theme); // Attheme { ... }
})();
import Attheme from "attheme-js";
import * as atthemeEditorApi from "attheme-editor-api";

(async () => {
  const themeId = await atthemeEditorApi.uploadTheme({
    name: `Chasing The Sun`,
    theme: new Attheme(`checkbox=#ff0000`),
  });

  const link = atthemeEditorApi.createOpenInEditorLink(themeId);

  console.log(`Click the link to open the theme in the browser: ${link}`);
})();

attheme-editor-api requires request-promise (and request therefore) for running in Node.js. If you want to use attheme-editor-api in the browser, import attheme-editor-api/browser which uses fetch instead of request-promise.

2.0.3

4 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago