# strawpolljs

> A simple Strawpoll API wrapper for NodeJS

Latest version **1.0.2** (published 2017-11-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install strawpolljs
pnpm add strawpolljs
yarn add strawpolljs
bun add strawpolljs
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2017-11-04 |
| First published | 2017-11-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | 0xbbadbeef |
| Maintainers | 0xbbadbeef |
| Keywords | strawpoll, wrapper, nodejs, api, simple |

## Links

- npm: https://www.npmjs.com/package/strawpolljs
- Repository: https://github.com/0xbbadbeef/strawpolljs
- Homepage: https://github.com/0xbbadbeef/strawpolljs#readme
- Issues: https://github.com/0xbbadbeef/strawpolljs/issues
- npm.io page: https://npm.io/package/strawpolljs

## Dependencies (2)

- [request](https://npm.io/package/request.md) ^2.34
- [request-promise](https://npm.io/package/request-promise.md) ^4.1.1

## Recent versions

- 1.0.2 (latest) — 2017-11-04
- 1.0.1 — 2017-11-04
- 1.0.0 — 2017-11-04

## README

# strawpolljs
A simple Strawpoll API wrapper for NodeJS

## Install

#### npm
~~~ bash
npm install strawpolljs
~~~

## Examples

#### Creating a strawpoll

You can simply create a new strawpoll like this:

~~~ javascript
strawpoll = require("strawpolljs");

strawpoll.createPoll({
	title: "This is the title of the poll", // The poll's title
	options: [ // An array of poll options
		"This is the first option",
		"This is the second option",
		"hmm, let's make a third option!"
	],
	multi: true, // Allows multiple answers (Strawpoll will use a checkbox for the options)
	dupcheck: "normal", // IP Duplication check state
	captcha: true // Should strawpoll use a Captcha?
});
~~~

strawpolljs uses promises, so you can read the poll data when the poll has been successfully created

~~~ javascript
strawpoll.createPoll({
  title: "This is the title of the poll", // The poll's title
	options: [ // An array of poll options
		"This is the first option",
		"This is the second option",
	],
}).then( function(response) {
  console.log(response); //The poll's data
});
~~~

#### Reading a straw poll

To read a strawpoll, all you need is the Identifcation Number (ID) of the particular poll

In our case, we will be reading poll '14323743's data
~~~ javascript
strawpoll.readPoll(14323743).then( function(result){ // Read poll '14323743's data
	console.log(result); // output the poll's data
});
~~~

---
_Source: https://npm.io/package/strawpolljs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
