open-index/open-npm huggingface dataset:
npm package: @grudge/api-events
Description: Shared socket events between @grudge/sdk and @grudge/server
Latest version: 2.0.10

# `@grudge/api-events`

> Shared socket events between @grudge/sdk and @grudge/server

## Usage

```
import { LOBBY_GET } from '@grudge/api-events';

socket.emit(LOBBY_GET, lobbyId);
```
npm package: @grudge/domain
Description: Grudge domain models
Latest version: 2.0.10

# `@grudge/domain`

> Grudge domain models

## Usage

```js
import { User } from '@grudge/domain';

// see the default property values
console.log(User.defaults);

// create an instance
const user = new User({ name: 'hello' });
const user2 = user.clone();
const user3 = User.create({ name: 'bobby' });

// see current properties
console.log(user.properties);
console.log(user.name);

// properties are frozen
user.name = 'jimmy'; // Error!
```
npm package: @grudge/sdk
Description: Client-side sdk for interacting with @grudge/server
Latest version: 2.0.10

# @grudge/sdk

> Client-side sdk for interacting with @grudge/server

## Usage

```js
import sdk from '@grudge/sdk';

// must be done before any query
sdk.configure(token);

// query
const user = await sdk.getUser(userId);
const lobby = await sdk.createLobby(lobbyData);
const currentUser = await sdk.whoAmI();

// listen
sdk.onUserCreated((user) => console.log(`User created`, user));
sdk.onConnecting(() => console.log('connecting'));
sdk.onConnected(() => console.log('socket has connected'));
sdk.onError((error) => console.log(`oops ${error.toString()}`));
```
npm package: @grudge/server
Description: Express server for Grudge
Latest version: 2.0.11

# @grudge/server

> Node server for @grudge/client

## Postgres Database

* For developing with the database locally
    * [install docker](https://www.docker.com/)
    * `$ docker-compose up` in the root
* environment variables should be setup in order to connect or migrate
    * `POSTGRES_USER="username"`
    * `POSTGRES_PASSWORD="password"`
    * `POSTGRES_DB="db name"`
    * `POSTGRES_HOST="127.0.0.1"`
    * `POSTGRES_PROTOCOL="http"`
    * `POSTGRES_PORT=5432`
* [adminer](https://www.adminer.org/) is used in development to inspect the database
    * started when `$ docker-compose up` is ran
    * visit `127.0.0.1:8080` for the dashboard
    * use the creditials above to sign in
* interaction with the database is done with [knex](https://github.com/tgriesser/knex)
* to migrate the database
    * `$ npm run db:migrate`
* to rollback migrations
    * `$ npm run db:rollback`
* to make a new migration
    * `$ npm i knex -g`
    * `$ knex migrate:make migration_name`
npm package: @grudge/styles
Description: Sass mixins and variables for Grudge styles
Latest version: 2.0.10

# `@grudge/styles`

> Sass mixins and variables for Grudge styles

## Usage

```scss
@import "@grudge/styles";

.article-title {
  font-size: @h2;
  color: $primary;
}

.news {
  padding: $spacer-2;
  background-color: $primary;
}
```