open-index/open-npm huggingface dataset:
npm package: @saulx/hub
Description: Front end state management
Latest version: 4.3.0

# Hub

![](https://img.shields.io/badge/code_style-standard-brightgreen.svg)

Front end react state management.
Grpc build in over websockets

```javascript
import { createClient } from '@saulx/hub'

const client = createClient()

const fn = () => {
  console.log('fire!')
}

// subscribe
client.rpc(
  {
    endpoint: 'f',
    method: 'subscribe',
    args: { uuid: 'firstname' }
  },
  fn
)

client.close(
  {
    endpoint: 'f',
    method: 'subscribe',
    args: { uuid: 'firstname' }
  },
  fn
)

// one off
const result = await client.rpc('f.subscribe', { hello: true })
```

Use it with react

```javascript
import { useRpc, useHub, Provider, createClient } from '@saulx/hub'
const client = createClient()

const Something = () => {
  // gives access to the hub context
  const hub = useHub()

  // handles unsubscribe / subscribe internally
  const myValue = useRpc('f.subscribe')
  
  // local values are on endpoint device
  const localValue = useRpc('device.value')

  return <div
    onClick={() => hub.set('device.value', Math.floor(Math.random() * 99))}
  >{myValue} {localValue}</div>
}

const App = () => {
  return (
    <Provider hub={client}>
      <Something />
    </Provider>
  )
}
```
npm package: @saulx/ops-core
Description: Cloud agnostic dev ops package based on pm2 and specific rules
Latest version: 1.2.2

# ops

Cloud agnostic dev ops package based on pm2 and specific rules

### Config

- cloud
  -config

  - default org
  - default project
  - default env
  - secrets (used in cloud abstraction)
  - s3 dist bucketName + region

  - listMachines
  - listDomain
  - listTags
  - createTag
  - removeTag
  - setDomainRecord
  - removeDomainRecord
  - createMachine
  - removeMachine
  - updateMachineSpecs
  - updateMachineTags
  - createLoadbalancer
  - removeLoadbalancer
  - updateLoadbalancerSpecs
  - updateLoadbalancerTags
  - uploadFileToS3
  - getFileFromS3
  - createGetFileFromS3ForService
  - pointCdnDist

- envServices []

### Build

- buildApp (using aristotle, put pm2 dep)
- buildService

### Tags

- createTag
- removeTag
- listTags

### File

- put
- get
- delete

### Service

- restartService
- stopService
- uploadService
- deployService

### Project

- listLocal (services and apps)
- listRemote
- cleanUpRemote
- cleanUpRemoteDns
- deployEnvServices
- deploy