Giter Site home page Giter Site logo

kinpost's Introduction

kinpost

npm version Build Status License: MIT

Description

Kinpost can upload any files to custom JavaScript (or CSS) forms via kintone REST API.

Installation

npm install --save-dev kinpost

or

yarn add --dev kinpost

Usage

  • Append any files to custom JavaScript (or CSS) form, if the same filename exists, overwrite an old file.
  • File uploads to Testing Environment. Use deploy option, if you need upload to Production Environment.
const kinpost = require('kinpost');

kinpost({
  domain: 'example.cybozu.com',
  app: 1,
  username: '[email protected]',
  password: '**********',
  files: [
    { path: './js/sample.js' },
    { path: './js/mobile.js', platform: 'mobile' },
    { path: './css/global.css', type: 'css' },
  ],
  deploy: true,
});

Parameters

name type required default description
domain string yes Your kintone sub domain name
app number yes Target kintone app ID
username string yes Login user name
password string yes Login user's password
files array yes File config list, please see next section
deploy boolean no false Deploy to Production Environment

File Config

name type required default description
path string yes Path of the file for upload
encoding string no utf-8 File encoding
platform string no desktop Target Platform. desktop or mobile
type string no js File type. js or css

Examples

Upload a sample.js file to custom JavaScript form for PC.

const kinpost = require('kinpost');

kinpost({
  domain: 'example.cybozu.com',
  app: 1,
  username: '[email protected]',
  password: '**********',
  files: [
    {
      path: './sample.js',
    },
  ],
});

Upload a mobile.js file to custom JavaScript form for Mobile.

const kinpost = require('kinpost');

kinpost({
  domain: 'example.cybozu.com',
  app: 1,
  username: '[email protected]',
  password: '**********',
  files: [
    {
      path: './js/mobile.js',
      platform: 'mobile',
    },
  ],
});

Upload a sample.js file to custom JavaScript form for PC, and global.css file to custom CSS form for PC.

const kinpost = require('kinpost');

kinpost({
  domain: 'example.cybozu.com',
  app: 1,
  username: '[email protected]',
  password: '**********',
  files: [
    {
      path: './js/sample.js',
    },
    {
      path: '/css/global.css',
      type: 'css',
    },
  ],
});

Licence

MIT License.

kinpost's People

Contributors

t-kojima avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.