open-index/open-npm huggingface dataset:
npm package: @nawt/block
Description: Basic generic component block with predefined CSS props
Author: Julian Low <hello@heyjul.es>
Latest version: 0.1.4

# @nawt/block

A flex-grid Styled Component with the option to define the number of columns for your flex grid.

### **Install**

```sh
# For NPM
npm install @nawt/block

# For Yarn
yarn add @nawt/block

# For PNPM
pnpm install @nawt/block
```

## **API**

### <**Block** \/>

Basic Block component which comprises of the following styled-system properties

- background
- border
- color
- display
- flexbox
- grid
- layout
- position
- shadow
- space
- typography

```ts
import { Block } from '@nawt/block';

export const MyBlock = () => {
  return (
    <Block p={5} fontSize="4rem" color="white" bg="red">
      My Block
    </Block>
  );
};
```
npm package: @nawt/colors
Description: Various color utilities with color value conversion functions and more
Author: Julian Low <hello@heyjul.es>
Latest version: 0.1.4

# @nawt/colors

A collection of colour value conversion utilities and other colour related functions.

## **API**

### **hexToRgb**(hex: `string`): `string`

This function converts a hex colour value to rgb.

```ts
hexToRgb('#000'); // returns string 'rgb(0, 0, 0)'
```

---

### **hexToRgba**(hex: `string`, alpha: `number`): `string`

Similar to hexToRgb with the difference that this function also returns an alpha value.

```ts
hexToRgba('#000', 0.5); // returns string 'rgba(0, 0, 0, 0.5)'
```

---

### **rgbToHex**(value: `any`): `string`

Converts a RGB colour values to a hex colour value.

```ts
// you can pass in 3 separate numbers each indicating R, G and B respectively as arguments
rgbToHex(97, 58, 136); // returns string '#613a88'

// or your can pass in a single string with a format like 'rgb(111,  147, 11)'
rgbToHex('rgb(111,  147, 11)'); // returns string '#6f930b'
```
npm package: @nawt/grid
Description: A component for quickly setting grid columns with capbility to define template auto columns.
Author: Julian Low <hello@heyjul.es>
Latest version: 0.1.4

# @nawt/grid

A simple grid Styled Component that allows for easy setting of repeatable columns.

### **Install**

```sh
# For NPM
npm install @nawt/grid

# For Yarn
yarn add @nawt/grid

# For PNPM
pnpm install @nawt/grid
```

## **API**

### <**Grid** \/>

The Grid component.

| Parameter    | Default Value | Type                 | Description                                                                                                       |
| :----------- | :------------ | :------------------- | :---------------------------------------------------------------------------------------------------------------- |
| columnWidth  | `n/a`         | `string \| string[]` | This will distribute column widths evenly across its immediate children eg. '200px' or ['50px', '100px', '150px'] |
| columnLength | `n/a`         | `number \| number[]` | This will distribute item widths automagically via the number of columns you set eg. 3 or [1, 2, 3]               |
| gap          | `1em`         | `string \| string[]` | Defines the gap width.                                                                                            |

```ts
import { Grid, GridItem } from '@nawt/flex';

// With columnWidths
export const MyFlexGrid = () => {
  return (
    <Grid columnWidth={["120px", "210px", "240px"]}>
      <GridItem}>Column 1</GridItem>
      <GridItem}>Column 2</GridItem>
      <GridItem}>Column 3</GridItem>
    </Grid>
  );
};

//  With columnLengths
export const MyFlexGrid = () => {
  return (
    <Grid columnLength={[1, 2, 3]}>
      <GridItem>Column 1</GridItem>
      <GridItem>Column 2</GridItem>
      <GridItem>Column 3</GridItem>
    </Grid>
  );
};

//  With gap
export const MyFlexGrid = () => {
  return (
    <Grid gap="2em">
      <GridItem>Column 1</GridItem>
      <GridItem>Column 2</GridItem>
      <GridItem>Column 3</GridItem>
    </Grid>
  );
};
```

---

### <**GridItem** \/>

As its name implies, this is the child component of the Grid component with several system props included. Typical usage is as follows

```ts
import { Grid, GridItem } from '@nawt/flex';

export const MyFlexGrid = () => {
  return (
    <Grid>
      <GridItem alignItems="center">Column 1</GridItem>
      <GridItem alignItems="center">Column 2</GridItem>
      <GridItem alignItems="center">Column 3</GridItem>
    </Grid>
  );
};
```
npm package: @nawt/styled
Description: A small library of styled-components utilities
Author: Julian Low <hello@heyjul.es>
Latest version: 0.1.4

# @nawt/styled

Styled Components library with styledObject and styledSet utitlities for creation of Styled Components.

### **Install**

```sh
# For NPM
npm install @nawt/styled

# For Yarn
yarn add @nawt/styled

# For PNPM
pnpm install @nawt/styled
```

## **API**

### **styledObject**(element: `TStyledElement`, styles: `CSSObject`, props: `Partial<TStyledObjectProps>`)

A utility function to help create styled objects complemented with Styled System properties. As the function name implies, this function only accepts styles that are in object literal syntax.

```ts
import { styledObject } from '@nawt/styled';

// Basic creation of a styled component with styledObject
export const MyStyledObject = styledObject('div', {
  display: 'flex'
});

// To which after, it can be used like a component
...
  <MyStyledObject>
    This is my styled object.
  </MyStyledObject>
...
```

### Typings

```ts
type TStyledElement =
  | keyof JSX.IntrinsicElements
  | StyledComponent<keyof JSX.IntrinsicElements, any, any, keyof any>;

type TStyledObjectProps = {
  attrs: any;
  compose: styleFn[];
  variants: VariantArgs;
  system: Config;
};
```

---

### **styledSet**(config: `TStyledSetConfig`, baseElement: `keyof JSX.IntrinsicElements`)

Similar to `styledObject` with the difference that this utility function creates bulk Styled Components as per the config that you provide.

```ts
import { styledSet } from '@nawt/styled';

export const { P, H1 } = styledSet(
  {
    base: {
      styles: {
        color: 'black'
      },
      element: 'p'
    },
    components: {
      P: {
        lineHeight: '1.2',
        as: 'p'
      },
      H1: {
        lineHeight: '1.3',
        as: 'h1'
      }
    }
  },
  'div'
);
```

### Typings

```ts
type TStyledConfig = Partial<{
  base: {
    styles: CSSObject;
    element: keyof JSX.IntrinsicElements;
    attrs?: any;
    compose?: styleFn[];
    variants?: VariantArgs;
    system?: Config;
  };
  components: Record<string, TStyledSetComponent>;
}>;

type TStyledSetComponent = Partial<{
  attrs: any;
  as: keyof JSX.IntrinsicElements;
  compose: styleFn[];
  variants: VariantArgs;
  system: Config;
}> &
  CSSObject;
```
npm package: @nawt/text
Description: Basic Text styled component with built-in text truncation functionality.
Author: Julian Low <hello@heyjul.es>
Latest version: 0.1.4

# @nawt/text

A text styled component with built-in props to specify overflow handling and also truncation via number of lines.

### **Install**

```sh
# For NPM
npm install @nawt/text

# For Yarn
yarn add @nawt/text

# For PNPM
pnpm install @nawt/text
```

---

## **API**

### <**Text** \/>

Text component with built-in text truncation capabilities. By default, renders as a `p` tag.

| Parameter      | Default Value | Type               | Description                                                   |
| :------------- | :------------ | :----------------- | :------------------------------------------------------------ |
| `trim`         | `n/a`         | `boolean`          | Defines whether or not to truncate text.                      |
| `noOfLines`    | `n/a`         | `number`           | Defines the allowed number of lines of text before truncating |
| `textOverflow` | `ellipsis`    | `clip \| ellipsis` | Defines what how hidden overflow content is presented         |

```ts
import { Text } from '@nawt/text';

// Regular text
export function MyText() {
  return (
    <Text>
      In fermentum consequat nulla, vitae consequat ante pharetra quis.
    </Text>
  );
}

// Single line text truncation
export function MyTrimmedText() {
  return (
    <Text trim={true}>
      In fermentum consequat nulla, vitae consequat ante pharetra quis.
    </Text>
  );
}

// Constrain multi-line text by 2 lines
export function MyLimitedLinesText() {
  return (
    <Text noOfLines={2}>
      In fermentum consequat nulla, vitae consequat ante pharetra quis. Maecenas
      imperdiet sit amet sapien et viverra. Vivamus tempor lobortis dolor, sed
      hendrerit odio tempor sed. Pellentesque tempor pretium orci vel maximus.
      Etiam eu tortor a nunc efficitur tincidunt. Nullam molestie tristique
      nulla. Vivamus semper, ipsum dapibus venenatis molestie, justo risus
      accumsan dolor, ut pulvinar mauris tortor non elit. Integer pulvinar ut
      eros et laoreet. Nullam tempus augue vitae auctor pulvinar. Praesent sit
      amet porta sem, non dignissim elit. Sed turpis nisi, dictum ut elit at,
      pretium vestibulum arcu. Sed lacinia congue nibh vitae semper. In
      efficitur, quam eleifend vulputate malesuada, diam mauris tincidunt quam,
      ut iaculis leo nisl vel leo. Mauris sed orci et lacus semper rutrum. Proin
      eu nunc eget sapien gravida aliquam eu vitae sapien.
    </Text>
  );
}
```
npm package: @nawt/units
Description: A utility library for CSS unit conversions.
Author: Julian Low <hello@heyjul.es>
Latest version: 0.1.4

# @nawt/units

A library for unit conversion and other unit related utilities.

### **Install**

```sh
# For NPM
npm install @nawt/units

# For Yarn
yarn add @nawt/units

# For PNPM
pnpm install @nawt/units
```

## **API**

### **pxToEm**(value: `string`, baseSize: `number`)

Converts px to em string.

```ts
import { pxToEm } from '@nawt/units';

pxToEm('48px'); // returns 3em
```

---

### **pxToRem**(value: `string`, baseSize: `number`)

Converts px to rem string.

```ts
import { pxToRem } from '@nawt/units';

pxToRem('48px'); // returns 3rem
```

---

### **emToPx**(value: `string`, baseSize: `number`)

Converts em to px string.

```ts
import { emToPx } from '@nawt/units';

emToPx('3em'); // returns 48px
```

---

### **remToPx**(value: `string`, baseSize: `number`)

Converts em to px string.

```ts
import { remToPx } from '@nawt/units';

remToPx('3em'); // returns 48px
```
npm package: @naxmefy/basename
Description: a simple micro lib to return the base name of given path...
Author: naxmefy
Latest version: 0.0.1

# @naxmefy/basename

a simple micro lib to return the base name of given path...

> If you see the code - you may understand why there shouldn't be a lib like this

## installation

```bash
$ npm i @naxmefy/basename
```

## usage

```javascript
const basename = require('@naxmefy/basename')
basename('C:\\users\\rofl\\example.jpeg') // will return --> example
```
npm package: @naxmefy/env
Description: env vars util
Author: MRW Neundorf
Latest version: 3.0.1

# @naxmefy/env

[![npm version](https://badge.fury.io/js/%40naxmefy%2Fenv.svg)](https://badge.fury.io/js/%40naxmefy%2Fenv)
![required node version](https://img.shields.io/badge/node-%3E%3D%206.x-green.svg)

[![Build Status](https://travis-ci.org/naxmefy/node-env.svg?branch=master)](https://travis-ci.org/naxmefy/node-env)
[![Coverage Status](https://coveralls.io/repos/github/naxmefy/node-env/badge.svg?branch=master)](https://coveralls.io/github/naxmefy/node-env?branch=master)

> **Type declarations included**

## Installation

```
$ npm install --save @naxmefy/env
```

## Usage

```TypeScript
import env from '@naxmefy/env'
const NodeEnv: string = env('NODE_ENV', 'development')
const aNumber: number = env('A_NUMBER', '10', Number)
const hello: string = env('USERNAME', 'John', v => `Hello ${v}!`)
```

### glob method

```TypeScript
import {glob} from '@naxmefy/env'

// e.g.:
interface IDBVars {
  DB_URL?: string
  DB_USER?: string
}

// load vars
const dbVars = glob('DB_*') as IDBVars

// e.g.:
console.log(dbVars.DB_URL)
console.log(dbVars.DB_USER)
```

## Support for Node.js <= 4

Use Versions 1.x.x

## Support for Node.js 5.x

Use Versions 2.x.x
npm package: @naxmefy/koa-controllers
Description: koa2 controllers
Author: MRW Neundorf
Latest version: 0.2.0

# node-koa-controllers

[![npm version](https://badge.fury.io/js/%40naxmefy%2Fkoa-controllers.svg)](https://badge.fury.io/js/%40naxmefy%2Fkoa-controllers)

[![Build Status](https://travis-ci.org/naxmefy/node-koa-controllers.svg?branch=master)](https://travis-ci.org/naxmefy/node-koa-controllers)
[![Coverage Status](https://coveralls.io/repos/github/naxmefy/node-koa-controllers/badge.svg?branch=master)](https://coveralls.io/github/naxmefy/node-koa-controllers?branch=master)

## Installation

```
$ npm install --save @naxmefy/koa-controllers
```

## Usage

```JavaScript
import * as Controllers from '@naxmefy/koa-controllers'

class MyKoaController extends Controllers.AppController {
  async myUsers (ctx) {
    this.body = yield ctx.db.findMyUsers()
  }

  async myUsersView (ctx) {
    ctx.state.users = yield ctx.db.findMyUsers()
    ctx.render('userListView')
  }
}
```
npm package: @naxmefy/koa-router-support
Description: koa-router support (koa2)
Author: MRW Neundorf
Latest version: 1.1.1

# node-koa-router-support

[![npm version](https://badge.fury.io/js/%40naxmefy%2Fkoa-router-support.svg)](https://badge.fury.io/js/%40naxmefy%2Fkoa-router-support)

[![Build Status](https://travis-ci.org/naxmefy/node-koa-router-support.svg?branch=master)](https://travis-ci.org/naxmefy/node-koa-router-support)
[![Coverage Status](https://coveralls.io/repos/github/naxmefy/node-koa-router-support/badge.svg?branch=master)](https://coveralls.io/github/naxmefy/node-koa-router-support?branch=master)

## Installation

```
$ npm install --save @naxmefy/koa-router-support
```

## Usage

```JavaScript
import KoaRouter from 'koa-router'
import koaRouterSupport from '@naxmefy/koa-router-support'

koaRouterSupport(KoaRouter)
```
npm package: @naxmefy/koa-starter
Description: koa2 starter
Author: MRW Neundorf
Latest version: 1.0.1

# node-koa-starter

[![npm version](https://badge.fury.io/js/%40naxmefy%2Fkoa-starter.svg)](https://badge.fury.io/js/%40naxmefy%2Fkoa-starter)

[![Build Status](https://travis-ci.org/naxmefy/node-koa-starter.svg?branch=master)](https://travis-ci.org/naxmefy/node-koa-starter)
[![Coverage Status](https://coveralls.io/repos/github/naxmefy/node-koa-starter/badge.svg?branch=master)](https://coveralls.io/github/naxmefy/node-koa-starter?branch=master)

## Installation

```
$ npm install --save @naxmefy/koa-starter
```

## Usage

```JavaScript
import Koa from 'koa'
import koaStarter from '@naxmefy/koa-starter'

const app = koaStarter(Koa, {})

if (!module.parent) {
  app.start()
}
```

## Usage (Testing - mocha + co-mocha + supertest)

```JavaScript
import supertest from 'supertest'
import app from '../src'

before(function () {
  this.app = koaStarter(Koa, {
      onBootstrap () {
        this.calledOnBooststrap = true
      }
    })
    this.request = supertest(this.app.start({
      port: null,
      ip: null
    }))
})

describe('app', function () {
  it('should be bootstrapped', function () {
    this.app.isBootstrapped.should.be.ok()
    this.app.calledOnBooststrap.should.be.ok()
  })

  it('should response 404', function * () {
    const response = yield this.request.get('/')

    response.status.should.be.eql(404)
  })
})
```
npm package: @naxmefy/mongoose-fex
Description: added several methods the mongoose schema to find, update or create documents. fex = find extensions
Author: MRW Neundorf
Latest version: 0.1.0

# node-mongoose-fex
added several methods the mongoose schema to find, update or create documents. fex = find extensions

## Prerequisites

you have to define a [promise library](http://mongoosejs.com/docs/promises.html)
in your mongoose installation, like:

* [bluebird](https://www.npmjs.com/package/bluebird)
* [mpromise](https://www.npmjs.com/package/mpromise)
* [q.Promise](https://www.npmjs.com/package/q)
* [ES6 Native Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)

```JavaScript
const mongoose = require('mongoose')
const Promise = require('bluebird')

mongoose.Promise = Promise
```

## Installation

```
$ npm install --save @naxmefy/mongoose-fex
```

## Usage

**Global**
```JavaScript
const mongoose = require('mongoose')
const mongooseFex = require('@naxmefy/mongoose-fex')

mongoose.plugin(mongooseFex)
```

**Per Schema**
```JavaScript
const mongoose = require('mongoose')
const mongooseFex = require('@naxmefy/mongoose-fex')

const schema = new mongoose.Schema({})
schema.plugin(mongooseFex)
```

## API

**findBy (String, Any [, Function])**
```JavaScript
model.findBy('test', testValue, function (err, documents) {})
```
> Hint: The plugin also creates findBy shortcuts per defined path
>
> **findBy{Key} (Any [, Function])**
> ```JavaScript
> const schema = new mongoose.Schema({
>   test: String
> })
> schema.plugin(mongooseFex)
> const model = mongoose.model('TestSchema', schema)
> model.findByTest(testString, function (err, documents) {
>   if (err) return console.error(err)
>   console.log(documents)
> })
> ```

**findOneBy (String, Any [, Function])**
```JavaScript
model.findOneBy('test', testValue, function (err, document) {})))
```
> Hint: The plugin also creates findOneBy shortcuts per defined path
>
> **findOneBy{Key} (Any [, Function])**
> ```JavaScript
> const schema = new mongoose.Schema({
>   test: String
> })
> schema.plugin(mongooseFex)
> const model = mongoose.model('TestSchema', schema)
> model.findOneByTest(testString, function (err, document) {
>   if (err) return console.error(err)
>   console.log(document)
> })
> ```

**findOneOrCreate (Object, Object [, Function])**
```JavaScript
model.findOneOrCreate({test: 'test'}, {test: 'test'}, function (err, document) {})))
```

**findByOrCreate (String, Array<Object> [, Function])**
```JavaScript
model.findByOrCreate('test', [{test: 'test1'}, {test: 'test2'}], function (err, documents) {})))
```

**findOneByOrCreate (String, Object [, Function])**
```JavaScript
model.findOneByOrCreate('test', {test: 'test'}, function (err, document) {})))
```
npm package: @naxmefy/socket
Description: autoreconnecting net.Socket implementation
Author: Mohammed R.W. Neundorf
Latest version: 1.3.0

# @naxmefy/socket

### Installation

```
$ npm install @naxmefy/socket --save
```

### Usage

For detailed usage, see Node.js documentation on net.Socket - https://nodejs.org/api/net.html#net_class_net_socket.

Quick example:

```javascript
const Socket = require('@naxmefy/socket')
var socket = Socket.connect(1337, 'localhost')

socket.setEncoding('utf8')
socket.on('connect', function () {
	// connected

socket.end('hey')
	socket.destroy()
})
```

**HINT**: To prevent socket from reconnecting, use `.destroy()` method to completely close it.

### Tests

```
$ npm test
```

### License

MIT
npm package: @naxmefy/utils
Description: collection of some utils
Author: MRW Neundorf
Latest version: 0.5.1

# node-utils (@naxmefy/utils)

collection of some utils

[![npm version](https://badge.fury.io/js/%40naxmefy%2Futils.svg)](https://badge.fury.io/js/%40naxmefy%2Futils)

[![Build Status](https://travis-ci.org/naxmefy/node-utils.svg?branch=master)](https://travis-ci.org/naxmefy/node-utils)
[![Coverage Status](https://coveralls.io/repos/github/naxmefy/node-utils/badge.svg?branch=master)](https://coveralls.io/github/naxmefy/node-utils?branch=master)

## Installation

```
$ npm install --save @naxmefy/utils
```

## Usage

```JavaScript
import * as utils from '@naxmefy/utils'
```