open-index/open-npm huggingface dataset:
npm package: @owsas/image-to-b64
Description: A module to convert images to b64 that also helps fetching them from the netwrok
Author: Juan Camilo Guarín P
Latest version: 0.0.3

# @owsas/image-to-b64

A module to convert images to b64 that also helps fetching them from the netwrok

## Installation

```sh
npm install --save @owsas/image-to-b64
```

## Usage

```js
import { ImageToB64 } from '@owsas/image-to-b64';

async function process() {
  const photoBuffer = await ImageToB64.fetchFromUrl('https://test.com/a.png');
  const base64 = ImageToB64.toBase64(photoBuffer);
  console.log(base64); // image/png;base64,AbCDEfGH...
}

process();
```

## API
```ts

type IFileTypeResponse = 'image/png' | 'image/jpg' | 'image/gif';

export class ImageToB64 {
  /**
   * Gets the response from a GET request to an url
   * @param url
   */
  public static fetchFromUrl(url: string): Promise<Buffer>;

  /**
   * Converts a buffer to base64 only data
   * @param buffer
   */
  public static toBase64OnlyData(buffer: Buffer): string;

  /**
   * Converts a buffer a to base64 with the type in the beginning
   * Ex: `image/png;base64,ABCD..`;
   * @param buffer
   * @param encodingOrUrl
   */
  public static toBase64(buffer: Buffer, encodingOrUrl: string): string;

  /**
   * Gets the type
   * @param input
   */
  public static getTypeForInput(input: string): IFileTypeResponse | '';
}
```


## Dev mode

Clone this repo, and start adding your code in the `index.ts` file.  
When you are done, write the tests in the `index.test.ts` file. For testing, this repo works with [Jest](https://facebook.github.io/jest/).

Once you finished, you can publish your module to npm with `npm publish`. This will compile your Typescript code
and send it to npm.

Make sure to change the name of the package in `package.json`

## Dev Features
* Testing with Jest
* Linting out of the box (checks the style of your code), with TSLint
* Build, prepublish and other scripts to help you to develop
* Works with Typescript: Static typing for your JS Applications, reducing amount of runtime errors
* Coverage out of the box, thanks to Jest
* Uses deterministic module resolving, with Yarn

## Credits

Developed by Juan Camilo Guarín Peñaranda,  
Otherwise SAS, Colombia  
2017

## License 

MIT.

## Support us on Patreon
[![patreon](./repo/patreon.png)](https://patreon.com/owsas)
npm package: @owsas/nominatim-js
Description: Unofficial JS SDK for the Nominatim Open Street Map service that allows geocoding and reverse geocoding
Author: Juan Camilo Guarín P
Latest version: 1.0.1

# Nominatim-JS

Unofficial JS SDK for the Nominatim Open Street Map service that allows geocoding and reverse geocoding

## How to use?

First, install the SDK
``` 
$> npm install --save @owsas/nominatim-js
```

Then, use it :). It works with Promises, or can be used with async / await.

### Example with promises

```js
const { NominatimJS } = require('@owsas/nominatim-js');

NominatimJS.search({
  q: 'bakery in new york'
}).then(results => {
  // do something with results
}).catch(error => {
  // error ocurred
})

```

### Example with async / await

```js
const { NominatimJS } = require('nominatim-js');

async function search(){
  let results = await NominatimJS.search({
    q: 'bakery in new york'
  });
}
```
NOTE: To await the response, the call to the API must be written inside an async function


### More examples 

See examples folder in the repository

## Author

Juan Camilo Guarín Peñaranda  
Otherwise SAS   
Colombia  

## License

MIT

## Support us on Patreon
[![patreon](./repo/patreon.png)](https://patreon.com/owsas)
npm package: @owsas/parse-server-addon-cloud-elasticsearch
Description: Parse Server Cloud Addon for syncing data to ElasticSearch
Author: Juan Camilo Guarín Peñaranda
Latest version: 0.1.6

# parse-server-addon-cloud-elasticsearch

Parse Server Cloud Addon for syncing data to ElasticSearch

## Install
```sh
npm install --save parse-server-addon-cloud-elasticsearch
```

## Usage
```js
// const module = require('parse-server-addon-cloud-elasticsearch');
// import module from 'parse-server-addon-cloud-elasticsearch';
```

## Dev Features
* Testing with Jest
* Linting out of the box (checks the style of your code), with TSLint
* Build, prepublish and other scripts to help you to develop
* Works with Typescript: Static typing for your JS Applications, reducing amount of runtime errors
* Coverage out of the box, thanks to Jest
* Uses deterministic module resolving, with `package-lock.json`
npm package: @owsas/pubnub-react-counter
Description: A channel occupancy counter for React
Author: Juan Camilo Guarin P
Latest version: 1.0.3

# pubnub-react-counter

![](https://api.travis-ci.org/owsas/pubnub-react-counter.svg?branch=master)

Count how many people are present in one pubnub channel with React.

## Demo
![](.repo/visitors.png)

## Usage
```jsx
import React from 'react';
import { render } from 'react-dom';
import PubNub from 'pubnub';

import Index from '../src/index';

const pubnub = new PubNub({
  publishKey: 'demo',
  subscribeKey: 'demo',
  ssl: true,
});

render(<p><Index channel="test-channel" pubnub={pubnub} /> visitor(s)</p>, document.getElementById('root'));
```


## Dev Mode
1. Clone this repository
1. Run `yarn install` (Usage of Yarn is recommended)
1. Edit the `src/index.jsx` file and then run `npm run dev`.  
1. This will start the `webpack-dev-server` 
1. Then open your browser at `localhost:3200`
1. The browser will be updated everytime you change the code at `src/index.jsx`

## Dev Features
* Linting with eslint
* Linting code style: Airbnb
* Testing with `jest@^21.2.1` and `enzyme@^3.1.1`
* Uses `babel` for JS transpiling
* Uses `webpack` for building the code

## Folder structure
* `/src`: The module code
* `/test`: The tests for the `src` components
* `/build`: The target compilation directory

## Credits
Juan Camilo Guarín Peñaranda  
[Otherwise SAS](https://github.com/owsas)  
Cali, Colombia, 2017

## License
MIT

## Support us on Patreon 
[![patreon](./.repo/patreon.png)](https://patreon.com/owsas)
npm package: @owsas/responsive
Description: Validators to detect if you are running on big or small screens, using a similar approach to Bootstrap, defining xs, sm, md or lg screen breakpoints.
Author: Juan Camilo Guarín P
Latest version: 1.0.9

# @owsas/responsive

Validators to detect if you are running on big or small screens, using a similar approach to Bootstrap, defining `xs`, `sm`, `md` or `lg` screen breakpoints.

## Installation
With npm:
```bash
npm install --save @owsas/responsive
```

With yarn:
```bash
yarn add @owsas/responsive
```

## Usage

```js
const { Responsive } = require('@owsas/responsive');

Responsive.isXs(100) // true
Responsive.isSm(600) // true
Responsive.isMd(300) // false
Responsive.isMd(800) // true
Responsive.isLg(1920) // true
```

If you provide no parameters, this module grabs the width from `window.innerWidth`.

```js
Responsive.isMd() // detects the window.innerWidth and says if it is a medium screen
```

### Setting new breakpoints
You may customize the breakpoints, using the function `setBreakpoints`

```js
Responsive.setBreakPoints({
  xs: 600, // xs devices are maximum 600px width
  sm: 800, // sm devices are maximum 800px width
  md: 1200 // md devices are maximum 1200px width
  // lg devices are > 1200px width
});
```


## Dev mode

Clone this repo, and start adding your code in the `index.ts` file.  
When you are done, write the tests in the `index.test.ts` file. For testing, this repo works with [Jest](https://facebook.github.io/jest/).

Once you finished, you can publish your module to npm with `npm publish`. This will compile your Typescript code
and send it to npm.

Make sure to change the name of the package in `package.json`

## Dev Features
* Testing with Jest
* Linting out of the box (checks the style of your code), with TSLint
* Build, prepublish and other scripts to help you to develop
* Works with Typescript: Static typing for your JS Applications, reducing amount of runtime errors
* Coverage out of the box, thanks to Jest
* Uses deterministic module resolving, with Yarn

## Credits

Developed by Juan Camilo Guarín Peñaranda,  
Otherwise SAS, Colombia    
http://owsas.com  
2018

## License 

MIT.

## Support us on Patreon
[![patreon](./repo/patreon.png)](https://patreon.com/owsas)
npm package: @owsas/sentiment-multilang
Description: Multilanguage AFINN-based sentiment analysis for Node.js
Author: davidemiceli
Latest version: 0.0.9

# sentiment-multilang
## Multilanguage AFINN-based sentiment analysis for Node.js

Sentiment is a Node.js module that uses the [AFINN-111](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6010) wordlist to perform [sentiment analysis](http://en.wikipedia.org/wiki/Sentiment_analysis) on arbitrary blocks of input text.

It supports the following languages: English, French, Spanish, German, Dutch and Italian. For languages other than english, it uses a locale transposition of AFINN-111 wordlist. The wordlist can be extended adding words too.  

Emojis are also supported: 
```js 
describe('Emoji', function() {
  test('It should detect the usage of emojis', function () {
    expect(sentiment('Te amo! 😍', 'es').vote).toEqual('positive');
  });
});
```
## Installation
`npm install @owsas/sentiment-multilang`

![](https://travis-ci.org/owsas/sentiment-multilang.svg?branch=master)

## Usage
```javascript
// Require the sentiment-multilang module
const { sentiment } = require('@owsas/sentiment-multilang');
// Get the sentiment from a text in a supported language
const result = sentiment('I had the most wonderful stay', 'en');  // result.vote = 'positive'
```

## Improvements
* All languages were moved to `langs` directory in separate `.json` files
* Code was moved to Typescript, and users can now see hints in their code
* Tests were moved to `jest`
* Testing with `travis`

## Credits
* Cloned repo: https://github.com/davidemiceli/sentiment-multilang 
* Emojis from: https://github.com/nicolasbonnici/node-sentiment/blob/master/lib/AFINN.js
* Dutch from: https://github.com/vdcrea/node-sentiment
* German from: https://github.com/vdcrea/node-sentiment

## Test
```bash
npm t # runs jest
```
npm package: @owsas/text-trimmer
Description: An npm module that helps you trimming text and adding tailing characters. Ex: Hello, my name...
Author: Juan Camilo Guarín P
Latest version: 1.0.8

# text-trimmer

An npm module that helps you trimming text and adding tailing characters. Ex: Hello, my name...

## Usage

```ts
import { trim } from '@owsas/text-trimmer';

// Trimming by number of words
const result = trim('This module helps trimming texts', { numWords: 3 });
console.log(result); // This module helps...

// Trimming by number of characters
const result = trim('This module helps trimming texts', { numChars: 5 });
console.log(result); // This ...

// Trimming with custom textTail
const result = trim('This module helps trimming texts', { numChars: 5, textTail: ':::' });
console.log(result); // This :::
```

## Dev mode

Clone this repo, and start adding your code in the `index.ts` file.  
When you are done, write the tests in the `index.test.ts` file. For testing, this repo works with [Jest](https://facebook.github.io/jest/).

Once you finished, you can publish your module to npm with `npm publish`. This will compile your Typescript code
and send it to npm.

Make sure to change the name of the package in `package.json`

## Dev Features
* Testing with Jest
* Linting out of the box (checks the style of your code), with TSLint
* Build, prepublish and other scripts to help you to develop
* Works with Typescript: Static typing for your JS Applications, reducing amount of runtime errors
* Coverage out of the box, thanks to Jest
* Uses deterministic module resolving, with Yarn

## Credits

Developed by Juan Camilo Guarín Peñaranda,  
Otherwise SAS, Colombia  
http://owsas.com
2018

## License 

MIT.

## Support us on Patreon 
[![patreon](./repo/patreon.png)](https://patreon.com/owsas)