# scriptserver-util

> Deprecated - Moved to @scriptserver/util

Latest version **1.2.1** (published 2021-09-14) · GPL-3.0 license · 0 weekly downloads

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

## Install

```sh
npm install scriptserver-util
pnpm add scriptserver-util
yarn add scriptserver-util
bun add scriptserver-util
```

## Health

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

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2021-09-14 |
| First published | 2016-09-28 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 7.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Garrett Cox |
| Maintainers | garrettjoecox |

## Links

- npm: https://www.npmjs.com/package/scriptserver-util
- Repository: https://github.com/garrettjoecox/scriptserver-util
- Homepage: https://github.com/garrettjoecox/scriptserver-util#readme
- Issues: https://github.com/garrettjoecox/scriptserver-util/issues
- npm.io page: https://npm.io/package/scriptserver-util

## Dependencies (2)

- [lodash.get](https://npm.io/package/lodash.get.md) ^4.4.2
- [lodash.defaultsdeep](https://npm.io/package/lodash.defaultsdeep.md) ^4.6.1

## Recent versions

- 1.2.1 (latest) — 2021-09-14
- 1.2.0 — 2020-05-01
- 1.1.0 — 2018-06-17
- 1.0.0 — 2018-03-31
- 0.1.1 — 2016-10-18
- 0.1.0 — 2016-09-28

## README

Deprecated - Moved to @scriptserver/util
====================

[![](http://i.imgur.com/zhptNme.png)](https://github.com/garrettjoecox/scriptserver)

FYI: This package is an addon for ScriptServer and requires ScriptServer to be set up, please see [here](https://github.com/garrettjoecox/scriptserver) for more information.

## Installation
While in root directory of your server run:
```
npm install scriptserver-util
```
And in your `server` file:
```javascript
server.use(require('scriptserver-util'));
```

## Usage
This module provides the following basic helper functions to help developers get started with modules.
```javascript
// .isOnline(username)
// Returns whether or not the player is online
server.util.isOnline('ProxySaw')
  .then(result => {
    if (result) doSomething();
    else doSomethingElse();
  });

// .wait(ms)
// Waits a given time (milliseconds) then continues to next promise in chain
server.doSomething(withSomething)
  .then(() => server.util.wait(1000))
  .then(() => doSomethingElse());

// .getLocation(username)
// Returns coordinates & dimension of given user if online
server.util.getLocation('ProxySaw')
  .then(loc => {
    console.log(loc.x);
    console.log(loc.y);
    console.log(loc.z);
    console.log(loc.dimension)
  });

// .tellRaw(text, target, options)
// Uses the minecraft command tellRaw to tell [target] [text] with [options]
server.util.tellRaw('Something went wrong!', '@a', {color: 'red'});
```

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