# sharepoint-promise

> A promise based wrapper around SharePoint's REST api

Latest version **0.0.16** (published 2016-08-02) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install sharepoint-promise
pnpm add sharepoint-promise
yarn add sharepoint-promise
bun add sharepoint-promise
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.0.16 |
| Published | 2016-08-02 |
| First published | 2016-05-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Stefan Legg |
| Maintainers | stefanlegg |
| Keywords | SharePoint, JavaScript, Promise |

## Links

- npm: https://www.npmjs.com/package/sharepoint-promise
- Repository: https://github.com/stefanlegg/sharepoint-promise
- Issues: https://github.com/stefanlegg/sharepoint-promise/issues
- npm.io page: https://npm.io/package/sharepoint-promise

## Dependencies (2)

- [es6-promise](https://npm.io/package/es6-promise.md) ^3.2.1
- [whatwg-fetch](https://npm.io/package/whatwg-fetch.md) ^1.0.0

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 0.0.16 (latest) — 2016-08-02
- 0.0.15 — 2016-08-02
- 0.0.14 — 2016-08-02
- 0.0.13 — 2016-07-27
- 0.0.12 — 2016-07-27
- 0.0.11 — 2016-06-13
- 0.0.10 — 2016-06-10
- 0.0.9 — 2016-06-09
- 0.0.8 — 2016-06-07
- 0.0.7 — 2016-06-07
- 0.0.6 — 2016-06-07
- 0.0.5 — 2016-06-07
- 0.0.4 — 2016-06-07
- 0.0.3 — 2016-06-02
- 0.0.2 — 2016-05-18

## README

# SharePoint Promise

A promise based wrapper around [SharePoint's REST api](https://msdn.microsoft.com/en-us/library/office/jj860569.aspx)

This project is under heavy development and is not recommended for use in production.

## Installation

It's simple with [npm](http://npmjs.com):

```sh
npm i --save sharepoint-promise
```

## Examples

### Get a list

```js
import SPPromise from 'sharepoint-promise'

SPPromise.getList('Contacts')
  .then((response) => {
    // do things
  })
```

### Get list items

```js
import SPPromise from 'sharepoint-promise'

SPPromise.getListItems('Contacts')
  .then((response) => {
    // do things
  })
```

### Get a list item

```js
import SPPromise from 'sharepoint-promise'

SPPromise.getListItemById('Contacts',1)
  .then((response) => {
    // do things
  })
```

### Create a list item

```js
import SPPromise from 'sharepoint-promise'

SPPromise.createListItem('Contacts',{Email:'test@example.com'})
  .then((response) => {
    // do things
  })
```

### Update a list item

```js
import SPPromise from 'sharepoint-promise'

SPPromise.updateListItem('Contacts',1,{Email:'newEmail@example.com'})
  .then((response) => {
    // do things
  })
```

### Run a custom query

```js
import SPPromise from 'sharepoint-promise'
// import some useful helper functions
import { json, log } from 'sharepoint-promise'

SPPromise.buildRequest('/some/api/path')
  .then(json) // gets the json body of the response
  .then(log) // logs the response
```

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