node-limesurvey
A limesurvey node.js client (with promise)
Last updated 3 months ago by sguilly .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install node-limesurvey 
SYNC missed versions from official npm registry.

node-limesurvey

A limesurvey node.js client (with promise)

Usage

<!> Do not forget to activate the LimeSurvey API first! To do this, access your global configuration, click on Interfaces and enable the API setting (JSON-RPC). <!>

More info : https://manual.limesurvey.org/RemoteControl_2_API

Code example

var fs = require('fs')

var limesurvey = require('node-limesurvey')({
    url: 'https://xxxxxxxx/index.php/admin/remotecontrol',
    username: 'xxxxx',
    password: 'xxxxx'
})


var start = async() => {

    // NOT MANDATORY - LIB AUTO (RE)GENERATE TOKEN IF NEEDED
    // let token = await limesurvey.getToken()
    // console.log('token', token)

    let surveys = await limesurvey.getSurveyList()
    console.log('surveys=', surveys)

    let survey = await limesurvey.getSurveyInfo('37436')
    console.log('survey=', survey)

    let questions = await limesurvey.getQuestions('37436')
    console.log('questions', questions)

    let groups = await limesurvey.getGroups('37436')
    console.log('groups', groups)

    let responses1 = await limesurvey.getResponsesBySurveyId('37436')
    console.log(responses1)

    let responses2 = await limesurvey.getResponsesByToken('37436', 'nKSAOM6JBYBDs2Q')
    console.log(responses2)

    let prettyResponses = await limesurvey.getPrettyResponses('37436')
    console.log(JSON.stringify(prettyResponses, null, 3))

    let content = await limesurvey.getStatistics('37436', 'xls')
    // fs.writeFile('/docs/stat.xls', content)

}

start()

Debug

This lib use https://www.npmjs.com/package/debug

DEBUG=* node example.js DEBUG=limesurvey node example.js

Current Tags

  • 0.0.2                                ...           latest (3 months ago)

2 Versions

  • 0.0.2                                ...           3 months ago
  • 0.0.1                                ...           3 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 2
Dependencies (2)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |