How to use abstract-sdk - 2 common examples

To help you get started, we’ve selected a few abstract-sdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jelleoverbeek / abstract-todo / server.js View on Github external
const Abstract = require("abstract-sdk");

// set the port of our application
// process.env.PORT lets the port be set by Heroku
let port = process.env.PORT || 3000;

nunjucks.configure("src/views", {
  autoescape: true,
  express: app,
  watch: true
});

app.use(express.static(__dirname + "/src/assets"));

// Create a client
const abstract = Abstract.Client();

const theProjects = [];

async function getAllProjects() {
  // Query all projects
  const projects = await abstract.projects.list().catch(error => {
    console.log(error);
  });

  return projects;
}

async function getComments(projectId) {
  const comments = await abstract.comments
    .list({
      projectId: projectId
github atlassian / sketch-plugin / scripts / gui-pack / publish.js View on Github external
#!/usr/bin/env node
const {
  promises: { writeFile, copyFile, mkdtemp, mkdir, stat },
} = require('fs');
const { join } = require('path');
const { tmpdir } = require('os');
const fetch = require('node-fetch');
const shell = require('shelljs');
const chalk = require('chalk');
const AbstractSDK = require('abstract-sdk');
const xml2js = require('xml2js');
const dotenv = require('dotenv');

dotenv.config();

const abstract = new AbstractSDK.Client({
  transportMode: 'cli',
});

const {
  ABSTRACT_PROJECT_ID,
  REMOTE_USER,
  REMOTE_HOST,
  REMOTE_PATH_BASE,
  URL_BASE,
  SHOULD_FORCE_PUBLISH,
} = process.env;

const URL_BASE_GUI_PACK = `${URL_BASE}/gui-pack`;

const INTERVAL_POLL = 10 * 60 * 1000; // 10 minutes
const URL_ICON = `${URL_BASE_GUI_PACK}/icon.png`;

abstract-sdk

Universal JavaScript bindings for the Abstract API and CLI

MIT
Latest version published 6 months ago

Package Health Score

72 / 100
Full package analysis

Popular abstract-sdk functions