open-index/open-npm huggingface dataset:
npm package: @sporttotal/aristotle-build
Description: Build for production
Latest version: 1.0.16

# build

Build for production

```ts
import build from 'ops-build'

const result = await build({
  entryPoints: ['index.js'],
  minify: true,
  outdir: 'dist'
})
```

Dev builds

```ts
import build from 'ops-build'

const result = await build({
  entryPoints: ['index.js'],
  sourcemap: true
})
```

Dev Server Example

```ts
import build from 'ops-build'

const buildOpts = {
  entryPoints: ['index.js'],
  sourcemap: true,
  watch: true
}

const render = ({ styles, scripts, files }) =>
  `<html>
    <head>
        ${styles.map(({ text }) => `<style>${text}</style>`).join('')}
    </head>
    <body>
        <div id="root"></div>
        ${scripts.map(({ url }) => `<script src="${url}"></script>`).join('')}
    </body>
</html>`

http.createServer(async (req, res) => {
  const result = await build(buildOpts)
  const { styles, scripts, files } = result
  if (!req.url || req.url === '/index.html') {
    res.writeHead(200, { 'content-type': 'text/html' })
    res.end(render(result))
  } else if (req.url in files) {
    res.writeHead(200, { 'content-type': files[req.url].type })
    res.end(Buffer.from(files[req.url].contents))
  } else {
    res.writeHead(404)
    res.end()
  }
})
```
npm package: @sporttotal/aristotle-create-server-dist
Description: ```js // dev server import serve from '@saulx/aristotle-serve'
Latest version: 1.0.17

# serve

```js
// dev server
import serve from '@saulx/aristotle-serve'

serve({
  port: 8080,
  build: {
    entryPoints: ['index.tsx'],
    sourcemap: true,
    watch: true,
    loader: { '.js': 'jsx' },
    define: {
      'process.env.NODE_ENV': '"dev"'
    }
  }
})
```

```js
// production server
import serve from '@saulx/aristotle-serve'

serve({
  port: 8080,
  build: 'build.json' // build.json is default
})
```

```js
// generic server could be
import serve from '@saulx/aristotle-serve'

serve({
  port: 8080,
  build:
    process.env.NODE_ENV === 'production'
      ? 'build.json'
      : {
          entryPoints: ['index.tsx'],
          sourcemap: true,
          watch: true,
          loader: { '.js': 'jsx' },
          define: {
            'process.env.NODE_ENV': '"dev"'
          }
        }
})
```
npm package: @sporttotal/aristotle-server
Description: ```js // dev server import serve from '@saulx/aristotle-serve'
Latest version: 1.0.2

# serve

```js
// dev server
import serve from '@saulx/aristotle-serve'

serve({
  port: 8080,
  build: {
    entryPoints: ['index.tsx'],
    sourcemap: true,
    watch: true,
    loader: { '.js': 'jsx' },
    define: {
      'process.env.NODE_ENV': '"dev"'
    }
  }
})
```

```js
// production server
import serve from '@saulx/aristotle-serve'

serve({
  port: 8080,
  build: 'build.json' // build.json is default
})
```

```js
// generic server could be
import serve from '@saulx/aristotle-serve'

serve({
  port: 8080,
  build:
    process.env.NODE_ENV === 'production'
      ? 'build.json'
      : {
          entryPoints: ['index.tsx'],
          sourcemap: true,
          watch: true,
          loader: { '.js': 'jsx' },
          define: {
            'process.env.NODE_ENV': '"dev"'
          }
        }
})
```
npm package: @sporttotal/aristotle-server-utils
Description: ```js // dev server import serve from '@saulx/aristotle-serve'
Latest version: 1.0.2

# serve

```js
// dev server
import serve from '@saulx/aristotle-serve'

serve({
  port: 8080,
  build: {
    entryPoints: ['index.tsx'],
    sourcemap: true,
    watch: true,
    loader: { '.js': 'jsx' },
    define: {
      'process.env.NODE_ENV': '"dev"'
    }
  }
})
```

```js
// production server
import serve from '@saulx/aristotle-serve'

serve({
  port: 8080,
  build: 'build.json' // build.json is default
})
```

```js
// generic server could be
import serve from '@saulx/aristotle-serve'

serve({
  port: 8080,
  build:
    process.env.NODE_ENV === 'production'
      ? 'build.json'
      : {
          entryPoints: ['index.tsx'],
          sourcemap: true,
          watch: true,
          loader: { '.js': 'jsx' },
          define: {
            'process.env.NODE_ENV': '"dev"'
          }
        }
})
```
npm package: @sporttotal/aristotle-types
Description: Build for production
Latest version: 1.0.1

# build

Build for production

```ts
import build from 'ops-build'

const result = await build({
  entryPoints: ['index.js'],
  minify: true,
  outdir: 'dist'
})
```

Dev builds

```ts
import build from 'ops-build'

const result = await build({
  entryPoints: ['index.js'],
  sourcemap: true
})
```

Dev Server Example

```ts
import build from 'ops-build'

const buildOpts = {
  entryPoints: ['index.js'],
  sourcemap: true,
  watch: true
}

const render = ({ styles, scripts, files }) =>
  `<html>
    <head>
        ${styles.map(({ text }) => `<style>${text}</style>`).join('')}
    </head>
    <body>
        <div id="root"></div>
        ${scripts.map(({ url }) => `<script src="${url}"></script>`).join('')}
    </body>
</html>`

http.createServer(async (req, res) => {
  const result = await build(buildOpts)
  const { styles, scripts, files } = result
  if (!req.url || req.url === '/index.html') {
    res.writeHead(200, { 'content-type': 'text/html' })
    res.end(render(result))
  } else if (req.url in files) {
    res.writeHead(200, { 'content-type': files[req.url].type })
    res.end(Buffer.from(files[req.url].contents))
  } else {
    res.writeHead(404)
    res.end()
  }
})
```
npm package: @sporttotal/get-package
Description: Get the nearest package.json
Latest version: 1.0.7

# get-package

Get the nearest package.json

### Default

```javascript
import getPkg from 'get-package'

getPkg('from-some-path').then(pkg => {
  console.log(pkg)
})

// Not passing a path defaults to process.cwd()
getPkg().then(pkg => {
  console.log(pkg)
})
```

### getPackagePath

```javascript
import { getPackagePath } from 'get-package'
getPackagePath('from-some-path').then(dirPath => {
  // package.json directory path
  console.log(dirPath)
})
```
npm package: @sporttotal/hub
Description: Front end state management
Latest version: 4.0.8

# 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: @sporttotal/ui
Description: Component library for data authoring apps
Latest version: 1.1.5

# ui

Component library for data authoring apps

- Input component
- Dropdown
- Modal
- Rich text editor
- Lists
- Grid
- Icons
- TextTitle
- TextBody
- TextSubtitle
- Button
- Checkbox
- Option
- Label
- Datepicker
- Multi select
- Auto suggest options
- ButtonLight
npm package: @sportunione/kegistration-api
Description: This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.3.0.
Latest version: 0.4.1

# KegistrationApi

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

## Code scaffolding

Run `ng generate component component-name --project kegistration-api` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project kegistration-api`.
> Note: Don't forget to add `--project kegistration-api` or else it will be added to the default project in your `angular.json` file. 

## Build

Run `ng build kegistration-api` to build the project. The build artifacts will be stored in the `dist/` directory.

## Publishing

After building your library with `ng build kegistration-api`, go to the dist folder `cd dist/kegistration-api` and run `npm publish`.

## Running unit tests

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

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.