Be more productive with these tools! ☔️ November picks for you
Tags: productivity, webdev, javascript, design
Published: 2019-11-06 06:54:08

Here we are for another round of interesting libraries!! Let's see what the month of November will  bring us. :tada:
&nbsp;


![Compressorjs](https://thepracticaldev.s3.amazonaws.com/i/hdjlf63em42naamy9kjd.png)

[Compressorjs](https://fengyuanchen.github.io/compressorjs/) is a library to compress images, as the name suggests :smile:.

It uses the HTMLCanvasElement.toBlob API for the compression process. 
A Blob object is created, representing the image contained in the canvas.

**Usage:**

```html
<input type="file" id="file" accept="image/*">
```

```javascript
import axios from 'axios';
import Compressor from 'compressorjs';

document.getElementById('file').addEventListener('change', (e) => {
  const file = e.target.files[0];

  if (!file) {
    return;
  }

  new Compressor(file, {
    quality: 0.6,
    success(result) {
      const formData = new FormData();

      // The third parameter is required for server
      formData.append('file', result, result.name);

      // Send the compressed image file to server with XMLHttpRequest.
      axios.post('/path/to/upload', formData).then(() => {
        console.log('Upload success');
      });
    },
    error(err) {
      console.log(err.message);
    },
  });
}); 
```

There are different [options](https://github.com/fengyuanchen/compressorjs#options) available to set max sizes or the quality of the output image for instance. The results I tried are pretty good, with a compression around 70% and still no significative quality loss.

![results](https://thepracticaldev.s3.amazonaws.com/i/83v3nvmle1saveavlg0o.png)

You can play with the [DEMO](https://fengyuanchen.github.io/compressorjs/) on the website.
&nbsp;

-----------------------------

&nbsp;
![pagemap](https://thepracticaldev.s3.amazonaws.com/i/ysgl4qc3rhwct0t6wd12.png)

[Pagemap](https://larsjung.de/pagemap/) is an interesting library allowing to create a minimap for your site, similar to some code editors like VS Code. It can be especially useful for pages with lot of text content.

![usage](https://thepracticaldev.s3.amazonaws.com/i/i3ukzplz4q9pdmrl0f3t.png)

The usage is pretty straightforward:

- Add a canvas tag to your HTML page:
```html
<canvas id='map'></canvas>
```

- Fix the position on the screen (here top right):
```css
#map {
    position: fixed;
    top: 0;
    right: 0;
    width: 200px;
    height: 100%;
    z-index: 100;
}
```

- Init and style the mini map according to your elements:
```javascript
pagemap(document.querySelector('#map'), {
    viewport: null,
    styles: {
        'header,footer,section,article': rgba(0,0,0,0.08),
        'h1,a': rgba(0,0,0,0.10),
        'h2,h3,h4': rgba(0,0,0,0.08)
    },
    back: rgba(0,0,0,0.02),
    view: rgba(0,0,0,0.05),
    drag: rgba(0,0,0,0.10),
    interval: null
});
```

Here a [DEMO](https://larsjung.de/pagemap/latest/demo/text.html).
&nbsp;

------------------------------

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/cvrhh9y7eiucr0qz3c65.png)

Mailgo library automatically opens a modal dialog when we click on :mailto and :tel links. It can redirect directly to Gmail or Outlook for emails and Telegram, WhatsApp or Skype for phone numbers.


**Usage:**

```html
<a href="mailto:mymail@gmail.com">mymail@gmail.com</a>
```

If you are scared to expose your email to potential spam, you can split the email address using the `data-address` and `data-domain` attributes:

```html
<a href="#mailgo" data-address="mymail" data-domain="gmail.com">write me!</a>
```

Click on the links of the demo to give it a try:

{% codepen https://codepen.io/manzinello/pen/RmeQEr %}

&nbsp;

------------------------------

![Vant](https://thepracticaldev.s3.amazonaws.com/i/9p8r95t4ssolzotcrc20.png)

[Vant](https://youzan.github.io/vant/#/en-US/intro) is a library of UI components created for mobile applications, based on Vue.js. It lists many components like Action Components which can provide their own methods & options.


Below an example with the Card component:

```html
<!-- Basic Usage -->
<van-card
  num="2"
  price="2.00"
  title="Title"
  desc="Description"
  thumb="https://img.yzcdn.cn/vant/t-thirt.jpg"
/>

<!-- Discount info -->
<van-card
  num="2"
  tag="Tag"
  price="2.00"
  title="Title"
  desc="Description"
  origin-price="10.00"
  thumb="https://img.yzcdn.cn/vant/t-thirt.jpg"
/>

<!-- Custom Card -->
<van-card
  num="2"
  title="Title"
  desc="Description"  
  price="2.00"
  thumb="https://img.yzcdn.cn/vant/t-thirt.jpg"
>
  <div slot="tags">
    <van-tag plain type="danger">Tag</van-tag>
    <van-tag plain type="danger">Tag</van-tag>
  </div>
  <div slot="footer">
    <van-button size="mini">Button</van-button>
    <van-button size="mini">Button</van-button>
  </div>
</van-card>
```

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/9lhpuj6orm468qh2h1rj.png)


Other than typical form elements like radio boxes, buttons and input fields, Van also provides file uploader, progress bars, swipe panel and password fields to mention some of its components.
Therefore it can be very useful to any Vue.js developer.
&nbsp;

------------------------------

&nbsp;
![quokkajs](https://thepracticaldev.s3.amazonaws.com/i/7zlxyu9otpo06bwl93uv.png)


[Quokka.js](https://quokkajs.com/) is a developer productivity tool for rapid JavaScript / TypeScript prototyping. Runtime values are updated and displayed in your IDE next to your code, as you type.<br>
Currently supported editors are: VS Code, JetBrains, Atom and Sublime Text and it comes in two versions: Community (free) and Pro.

![License](https://thepracticaldev.s3.amazonaws.com/i/zv4n0lq47is80uyhjmtl.png)

Some of its interesting features are:

#### Live Code Coverage

Once Quokka.js is running, you can see the code coverage on the left side of your editor. The coverage is live, so by changing the code the coverage will automatically be updated accordingly. This is a nice feature coming from the Wallaby.js product (the same team is behind quokka).

![CodeCoverage](https://thepracticaldev.s3.amazonaws.com/i/mcpxv27fs60azekg8w3j.gif)
&nbsp;

#### Live Feedback

You may create a new Quokka file, or start Quokka on an existing file. The results of the execution are displayed right in the editor. 

![LiveFeedback](https://thepracticaldev.s3.amazonaws.com/i/5z7w4k0mxvoi6jkvveum.gif)
&nbsp;

#### Live Values Display (PRO version)

While the Live Comments feature provides an excellent way to log expression values and will keep displaying values when you change your code, sometimes you may want to display or capture expression values without modifying code. The Show Value and Copy Value features allow you to do exactly that.

To use these features, the expression being logged either needs to be selected, or the cursor position needs to be right after the expression when the command is invoked.

![LiveFeedback](https://thepracticaldev.s3.amazonaws.com/i/oqwsiirr7f2rhuyahu5b.gif)

&nbsp;

---------------------------------------

&nbsp;

This concludes our November list. Come back next month to see some new libraries from the web. :raising_hand:


![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/6c2a9y6x9ii54fb20vt3.jpg)