open-index/open-npm huggingface dataset:
npm package: @polytope/persistence
Description: [![Build Status](https://travis-ci.org/ptope/persistence.svg?branch=master)](https://travis-ci.org/ptope/persistence)
Latest version: 1.0.0

# PersistenceLib

[![Build Status](https://travis-ci.org/ptope/persistence.svg?branch=master)](https://travis-ci.org/ptope/persistence)

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.6.7.

## Development server

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.

## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
npm package: @polytoria/shop
Description: Polytoria official shop wrapper.
Latest version: 1.4.2

Require the shop wrapper.

```js
const shop = require("polytoria/shop");
```

Fetch catalog pages:

```js
const AllItems = shop.fetchCatalog(1); // First page.
```

We use promises to handle data.

```js
Allitems.then((data) => {
  console.log(data);
});
```

This will return an array like this:

```json
[
  {
    "AssetID": 8124,
    "AssetName": "Bamboo Spear",
    "AssetType": "hat",
    "Price": 120,
    "Currency": "Studs",
    "Limited": false,
    "CreatorID": 0,
    "Version": 1,
    "CreatorURL": "/user/1",
    "CreatorName": "Polytoria",
    "BestPrice": 0
  },
  {
    "AssetID": 8118,
    "AssetName": "Blue Gem Chains",
    "AssetType": "hat",
    "Price": 35,
    "Currency": "Studs",
    "Limited": true,
    "CreatorID": 1,
    "Version": 1,
    "CreatorURL": "/user/1",
    "CreatorName": "Polytoria",
    "BestPrice": 150
  }
]
```

But much more bigger. Just handle the data like this:

```js
Allitems.then((data) => {
  data.forEach((asset) => {
    console.log("Asset name:" + asset.name);
  });
});
```

This will display all the item names on page 1.

#### API Wrapper docs.

We have different functions on the api wrapper.

```js
fetchItem((itemID: number));
```

Returns JSON with item information.

```js
getSales((ItemID: number));
```

Returns JSON of the item sales, including time, purchaser and some other good information.

```ts
getOwners(itemID : number, limit : number, page : number );
```

Fetches all owners of an item and returns JSON.

By default **getOwners** has the limit set to 20, and page 1.

### Promises.

All the functions are promised based, thus:

```js
const shop = require("...");
console.log(shop.getOwners(9123)); // WONT WORK!

/**
 * This will work!
 */
const Owners = shop.getOwners(9123);
Owners.then((ownerData) => {
  console.log(ownerData); // Returns the JSON!
});
```
npm package: @polytoria/users
Description: An API for users.
Author: Shigero
Latest version: 1.2.3

### User API!

The user API is a really good way to get and handle data from the polytoria API.

#### getFromUsername()
**Static**
This function returns user information through the Username.
```js
const User = require('@polytoria/users');

User.getFromUsername('NodeJS').then((result)=>{
    console.log(result.Username); // NodeJS
    console.log(result.Rank); // ADMINISTRATOR
    console.log(result.Description) // NodeJS long ass description lol
})
```
#### getFriends();
Function to gather an array of friends of the user.
```js
const Polytoria = new User(1);
const PolyFriends = Polytoria.getFriends().then((friends)=>{
    console.log(friends); // [{username: blah blah}, {username: willemstinky}] etc....
})
```

#### getUserData();
A function to get all user data.
```js
const Polytoria = new User(1);
const PolyData = Polytoria.getUserData().then((Data)=>{
    console.log(Data.Username); // Polytoria
})
```