@kyso/publish
v1.2.1
Published
## Installation
Downloads
3
Readme
@kyso/publish
Installation
npm install @kyso/publish
or
yarn add @kyso/publish
Usage
Publish
const { publish } = require('@kyso/publish')
publish({
name, // the name of the study to be published
main, // the main file to be rendered on kyso
user, // kyso user object with at least nickname (str) sessionToken (str), and objectId (str)
files, // optional (for use in browser) is an array of files
onProgress, // option function to check progress
directory, // optional (for use with nodejs) is a local folder to read the files from
apiUrl // url of kyso api, defaults to https://api.kyso.io
})
files (for use in browser) is an array of files in the form:
{
data: Buffer,
path: String,
}
Buffer
This is useful for preparing files in a browser, turns a string into a buffer
const { Buffer } = require('@kyso/publish')
const buf = Buffer.from('somestring')