# vanilla-website-utils

> Vanilla JS utility functions for daily website usage

Latest version **1.18.8** (published 2025-12-15) · GPL-3.0-or-later license · 0 weekly downloads

## Install

```sh
npm install vanilla-website-utils
pnpm add vanilla-website-utils
yarn add vanilla-website-utils
bun add vanilla-website-utils
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: no vulnerabilities; has provenance; high maintenance score.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 1.18.8 |
| Published | 2025-12-15 |
| First published | 2021-11-18 |
| Weekly downloads | 0 |
| License | GPL-3.0-or-later |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 469.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 2 |
| Author | info@myridia.com |
| Maintainers | veto64 |
| Keywords | website, webpage, vanilla, vanilla-website-util, utils, read csv file, util, utilities, helper, functions |

## Links

- npm: https://www.npmjs.com/package/vanilla-website-utils
- Repository: https://github.com/myridia/vanilla-website-utils
- Homepage: https://vanilla-website-utils.myridia.com
- Issues: https://github.com/myridia/vanilla-website-utils/issues
- npm.io page: https://npm.io/package/vanilla-website-utils

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 1.18.8 (latest) — 2025-12-15
- 1.18.7 — 2025-12-10
- 1.18.0 — 2025-11-26
- 1.17.1 — 2025-11-10
- 1.17.0 — 2025-11-10
- 1.16.2 — 2025-10-03
- 1.16.1 — 2025-10-03
- 1.16.0 — 2025-10-02
- 1.15.0 — 2025-09-29
- 1.14.1 — 2025-09-02
- 1.14.0 — 2025-08-29
- 1.13.0 — 2025-08-07
- 1.12.0 — 2025-07-25
- 1.11.2 — 2025-04-11
- 1.10.2 — 2025-04-04
- … 54 more at https://npm.io/package/vanilla-website-utils/versions

## README

# Vanilla-website-utils
Vanilla JS utility functions
for daily website usage

# Feeback
If you are using or are interested in this module, please send me some Feedback.
Any comment, request or critic is welcome!
veto@myridia.com

# Install 
```bash
  npm install vanilla-website-utils
```

# Usage:
```html
  <script src="../node_modules/vanilla-website-utils/dist/vanilla-website-utils.js"></script>
```


## Example Usage:
```javascript
  var vu = new Vanilla_website_utils();
  window.onload = async function()
  {
	const host = await vu.get_host();
	const v = await vu.get_parameters();
	console.log(host);
	console.log(v);
  };
   	
```

## Functions:

```html
    <form>
      <input  id="test" class="test" />
    </form>
```

```javascript
   await vwu.autoload_textfield("http://127.0.0.1:8051/book_authors_name?f=data&_max=100",'test','test')
```

## Clone the Source via SSH:
```
git clone git@github.com:myridia/vanilla-website-utils.git
```

<a name="module_Vanilla-website-utils"></a>

## Vanilla-website-utils
GPL licenses
A module for Vanilla-website-utils


* [Vanilla-website-utils](#module_Vanilla-website-utils)
    * [module.exports#extract_anchor_value(str)](#exp_module_Vanilla-website-utils--module.exports+extract_anchor_value) ⇒ <code>str</code> ⏏
    * [module.exports#shuffle_array(array, length)](#exp_module_Vanilla-website-utils--module.exports+shuffle_array) ⇒ <code>array</code> ⏏
    * [module.exports#remove_tags()](#exp_module_Vanilla-website-utils--module.exports+remove_tags) ⇒ <code>string</code> ⏏
    * [module.exports#is_number(value)](#exp_module_Vanilla-website-utils--module.exports+is_number) ⇒ <code>boolean</code> ⏏
    * [module.exports#round(number, decimal)](#exp_module_Vanilla-website-utils--module.exports+round) ⇒ <code>float</code> ⏏
    * [module.exports#get_month_back(yrs)](#exp_module_Vanilla-website-utils--module.exports+get_month_back) ⇒ <code>array</code> ⏏
    * [module.exports#csv_file_to_array(file)](#exp_module_Vanilla-website-utils--module.exports+csv_file_to_array) ⇒ <code>array</code> ⏏
    * [module.exports#clear_textarea()](#exp_module_Vanilla-website-utils--module.exports+clear_textarea) ⏏
    * [module.exports#sort_object(obj, sort_order)](#exp_module_Vanilla-website-utils--module.exports+sort_object) ⇒ <code>array</code> ⏏
    * [module.exports#from_112_to_date(str, add_days)](#exp_module_Vanilla-website-utils--module.exports+from_112_to_date) ⇒ <code>object</code> ⏏
    * [module.exports#date_to_112(_date)](#exp_module_Vanilla-website-utils--module.exports+date_to_112) ⇒ <code>string</code> ⏏
    * [module.exports#month_list(month_back, revert, format)](#exp_module_Vanilla-website-utils--module.exports+month_list) ⇒ <code>arry</code> ⏏
    * [module.exports#get_host(ext)](#exp_module_Vanilla-website-utils--module.exports+get_host) ⇒ <code>string</code> ⏏
    * [module.exports#clean_url_parameters()](#exp_module_Vanilla-website-utils--module.exports+clean_url_parameters) ⇒ <code>string</code> ⏏
    * [module.exports#get_parameters(url)](#exp_module_Vanilla-website-utils--module.exports+get_parameters) ⇒ <code>object</code> ⏏
    * [module.exports#get_select_text_by_value(select, value)](#exp_module_Vanilla-website-utils--module.exports+get_select_text_by_value) ⇒ <code>string</code> ⏏
    * [module.exports#add_parameters(url, parameters)](#exp_module_Vanilla-website-utils--module.exports+add_parameters) ⇒ <code>string</code> ⏏
    * [module.exports#afetch_all(callback, ...urls)](#exp_module_Vanilla-website-utils--module.exports+afetch_all) ⇒ <code>array</code> ⏏
    * [module.exports#wait_for_all(...ps)](#exp_module_Vanilla-website-utils--module.exports+wait_for_all) ⇒ <code>promise</code> ⏏
    * [module.exports#afetch(i)](#exp_module_Vanilla-website-utils--module.exports+afetch) ⇒ <code>array</code> ⏏
    * [module.exports#handle_rejection(p)](#exp_module_Vanilla-website-utils--module.exports+handle_rejection) ⇒ <code>objet</code> ⏏
    * [module.exports#aget_api(url, user, password, token)](#exp_module_Vanilla-website-utils--module.exports+aget_api) ⇒ <code>object</code> ⏏
    * [module.exports#aput_api(url, data, content_type)](#exp_module_Vanilla-website-utils--module.exports+aput_api) ⇒ <code>object</code> ⏏
    * [module.exports#apost_api(url, data, content_type)](#exp_module_Vanilla-website-utils--module.exports+apost_api) ⇒ <code>object</code> ⏏
    * [module.exports#post_api(url, my_callback, _data)](#exp_module_Vanilla-website-utils--module.exports+post_api) ⇒ <code>object</code> ⏏
    * [module.exports#_email_validator(email)](#exp_module_Vanilla-website-utils--module.exports+_email_validator) ⇒ <code>bolan</code> ⏏
    * [module.exports#email_validator(email)](#exp_module_Vanilla-website-utils--module.exports+email_validator) ⇒ <code>bolan</code> ⏏
    * [module.exports#get_url_parameter(name)](#exp_module_Vanilla-website-utils--module.exports+get_url_parameter) ⇒ <code>string</code> ⏏
    * [module.exports#get_site()](#exp_module_Vanilla-website-utils--module.exports+get_site) ⇒ <code>string</code> ⏏
    * [module.exports#autocomplete_textfield(setting, search)](#exp_module_Vanilla-website-utils--module.exports+autocomplete_textfield) ⏏
    * [module.exports#autocomplete_select(setting)](#exp_module_Vanilla-website-utils--module.exports+autocomplete_select) ⏏
    * [module.exports#_set_textfield()](#exp_module_Vanilla-website-utils--module.exports+_set_textfield) ⏏
    * [module.exports#autoload_textfield()](#exp_module_Vanilla-website-utils--module.exports+autoload_textfield) ⏏
    * [module.exports#autocomplete()](#exp_module_Vanilla-website-utils--module.exports+autocomplete) ⏏
    * [module.exports#post_textfield_rows(id, url, callback)](#exp_module_Vanilla-website-utils--module.exports+post_textfield_rows) ⇒ <code>callback</code> ⏏
    * [module.exports#get_form_data(form)](#exp_module_Vanilla-website-utils--module.exports+get_form_data) ⇒ <code>array</code> ⏏
    * [module.exports#s_fill_select(select_obj, data)](#exp_module_Vanilla-website-utils--module.exports+s_fill_select) ⏏
    * [module.exports#fill_select(select_obj, data, selected, copy2clipboard, log)](#exp_module_Vanilla-website-utils--module.exports+fill_select) ⏏
    * [module.exports#pad(number)](#exp_module_Vanilla-website-utils--module.exports+pad) ⇒ <code>string</code> ⏏
    * [module.exports#s_set_selected(select_obj, data)](#exp_module_Vanilla-website-utils--module.exports+s_set_selected) ⏏
    * [module.exports#set_selected()](#exp_module_Vanilla-website-utils--module.exports+set_selected) ⏏

<a name="exp_module_Vanilla-website-utils--module.exports+extract_anchor_value"></a>

### module.exports#extract\_anchor\_value(str) ⇒ <code>str</code> ⏏
**Kind**: Exported function  
**Returns**: <code>str</code> - - extract anchor value  

| Param | Type | Description |
| --- | --- | --- |
| str | <code>str</code> | anchor string |

**Example**  
```js
var vwu = new Vanilla_website_utils();
let str = "<a href=www.data.com>123.321</a>";
let v = vwu.extract_anchor_value(str);
```
<a name="exp_module_Vanilla-website-utils--module.exports+shuffle_array"></a>

### module.exports#shuffle\_array(array, length) ⇒ <code>array</code> ⏏
**Kind**: Exported function  
**Returns**: <code>array</code> - - new shuffled array  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| array | <code>array</code> |  | array to be shuffled |
| length | <code>int</code> | <code>0</code> | length of the new returning array |

**Example**  
```js
var vwu = new Vanilla_website_utils();
const array = ["a","b","c","d","e","f","g","h","i"];
const new_array = await vwu.shuffle_array(array);
```
<a name="exp_module_Vanilla-website-utils--module.exports+remove_tags"></a>

### module.exports#remove\_tags() ⇒ <code>string</code> ⏏
**Kind**: Exported function  
**Returns**: <code>string</code> - - string with the tags removed  

| Param | Type | Description |
| --- | --- | --- |
|  | <code>string</code> | string what contains html tags |

**Example**  
```js
var vwu = new Vanilla_website_utils();
var new_string = vwu.remove_tags(string)
```
<a name="exp_module_Vanilla-website-utils--module.exports+is_number"></a>

### module.exports#is\_number(value) ⇒ <code>boolean</code> ⏏
**Kind**: Exported function  
**Returns**: <code>boolean</code> - - returns true for number or float  

| Param | Type | Description |
| --- | --- | --- |
| value | <code>string</code> | string to check if its a number or float |

**Example**  
```js
var vwu = new Vanilla_website_utils();
document.querySelector("#input").addEventListener("change", function(){
let r = vwu.is_number("12,16346");
},false)
```
<a name="exp_module_Vanilla-website-utils--module.exports+round"></a>

### module.exports#round(number, decimal) ⇒ <code>float</code> ⏏
**Kind**: Exported function  
**Returns**: <code>float</code> - - rounded float number  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| number | <code>float</code> |  | float number to round |
| decimal | <code>integer</code> | <code>0</code> | level of decimal to round |

**Example**  
```js
var vwu = new Vanilla_website_utils();
document.querySelector("#input").addEventListener("change", function(){
let arr = vwu.round(12,16346,2);
},false)
```
<a name="exp_module_Vanilla-website-utils--module.exports+get_month_back"></a>

### module.exports#get\_month\_back(yrs) ⇒ <code>array</code> ⏏
**Kind**: Exported function  
**Returns**: <code>array</code> - - file object with month back in time with the starting and end date of a 112 date format  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| yrs | <code>int</code> | <code>0</code> | number of years back in time - default is 0, what brings only the actual year |

**Example**  
```js
var vwu = new Vanilla_website_utils();
months = vwu.get_month_back(5)
```
<a name="exp_module_Vanilla-website-utils--module.exports+csv_file_to_array"></a>

### module.exports#csv\_file\_to\_array(file) ⇒ <code>array</code> ⏏
**Kind**: Exported function  
**Returns**: <code>array</code> - - the collected data from the csv file into an array  

| Param | Type | Description |
| --- | --- | --- |
| file | <code>object</code> | file object from a HTML website |

**Example**  
```js
var vwu = new Vanilla_website_utils();
document.querySelector("#input").addEventListener("change", function(){
let arr = vwu.file_to_array(this.files[0]);
},false)
```
<a name="exp_module_Vanilla-website-utils--module.exports+clear_textarea"></a>

### module.exports#clear\_textarea() ⏏
**Kind**: Exported function  
**Example**  
```js
var vwu = new Vanilla_website_utils();
vwu.clear_textarea()
```
<a name="exp_module_Vanilla-website-utils--module.exports+sort_object"></a>

### module.exports#sort\_object(obj, sort_order) ⇒ <code>array</code> ⏏
**Kind**: Exported function  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| obj | <code>object</code> |  | javascript object |
| sort_order | <code>string</code> | <code>&quot;desc&quot;</code> | desc or asc  (default desc) |

**Example**  
```js
var vwu = new Vanilla_website_utils();
let obj = {a:100,b:50,c:75,d:1};
let a = vwu.sort_object('desc'); 
```
<a name="exp_module_Vanilla-website-utils--module.exports+from_112_to_date"></a>

### module.exports#from\_112\_to\_date(str, add_days) ⇒ <code>object</code> ⏏
**Kind**: Exported function  
**Returns**: <code>object</code> - - date object  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| str | <code>str</code> |  | a 112 string type date |
| add_days | <code>int</code> | <code>0</code> | add days or remove by adding -1 or 1 |

**Example**  
```js
var vwu = new Vanilla_website_utils();
let date = vwu.112_to_date('20240601'); 
```
<a name="exp_module_Vanilla-website-utils--module.exports+date_to_112"></a>

### module.exports#date\_to\_112(_date) ⇒ <code>string</code> ⏏
**Kind**: Exported function  
**Returns**: <code>string</code> - - in 112 format like 20230515  

| Param | Type | Description |
| --- | --- | --- |
| _date | <code>object</code> | dateobject |

**Example**  
```js
var vwu = new Vanilla_website_utils();
let date = new Date();
let iso_112 = vwu.date_to_112(date); 
```
<a name="exp_module_Vanilla-website-utils--module.exports+month_list"></a>

### module.exports#month\_list(month_back, revert, format) ⇒ <code>arry</code> ⏏
**Kind**: Exported function  
**Returns**: <code>arry</code> - - list of month in format like 10.2022  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| month_back | <code>int</code> | <code>12</code> | number of month back |
| revert | <code>bolean</code> | <code>false</code> | revert order - Default is false |
| format | <code>string</code> | <code>&quot;&#x60;${j}.${i}&#x60;&quot;</code> | return format of the month year pair - Default {j}.{i} like 09.2022 | j = month | i =year | |

**Example**  
```js
var vwu = new Vanilla_website_utils();
let data = await vwu.month_list(60,true,"`${j}.${i}`");
```
<a name="exp_module_Vanilla-website-utils--module.exports+get_host"></a>

### module.exports#get\_host(ext) ⇒ <code>string</code> ⏏
**Kind**: Exported function  
**Returns**: <code>string</code> - - the hostname  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| ext | <code>string</code> | <code>&quot;html&quot;</code> | extentison |

**Example**  
```js
var vwu = new Vanilla_website_utils();
let host = await vwu.get_host();
```
<a name="exp_module_Vanilla-website-utils--module.exports+clean_url_parameters"></a>

### module.exports#clean\_url\_parameters() ⇒ <code>string</code> ⏏
**Kind**: Exported function  
**Returns**: <code>string</code> - removed  empty parameters -parameters with an empty string  or none  
**Example**  
```js
var vwu = new Vanilla_website_utils();                                        
url in the addressbar = "http://foo.com?key=bar&key2=&key3=barbar"           
url = await vwu.add_parameters();
await vwu.clean_url_parameters();
the addressbar will be changed to "http://foo.com?key3=barbar"                                  
```
<a name="exp_module_Vanilla-website-utils--module.exports+get_parameters"></a>

### module.exports#get\_parameters(url) ⇒ <code>object</code> ⏏
**Kind**: Exported function  
**Returns**: <code>object</code> - json pair key/value -- new line value will be return as array!  

| Param | Type | Description |
| --- | --- | --- |
| url | <code>string</code> | url |

**Example**  
```js
var vwu = new Vanilla_website_utils();
let v = await vwu.get_parameters();
```
<a name="exp_module_Vanilla-website-utils--module.exports+get_select_text_by_value"></a>

### module.exports#get\_select\_text\_by\_value(select, value) ⇒ <code>string</code> ⏏
**Kind**: Exported function  
**Returns**: <code>string</code> - text  

| Param | Type | Description |
| --- | --- | --- |
| select | <code>object</code> | the DOM select object |
| value | <code>string</code> | value |

**Example**  
```js
var vwu = new Vanilla_website_utils();
let mytext = await vwu.get_select_text_by_value(document.querySelector("#resource"), v['resource'],v['resource']);
```
<a name="exp_module_Vanilla-website-utils--module.exports+add_parameters"></a>

### module.exports#add\_parameters(url, parameters) ⇒ <code>string</code> ⏏
**Kind**: Exported function  
**Returns**: <code>string</code> - url plus the new parameters  

| Param | Type | Description |
| --- | --- | --- |
| url | <code>string</code> | original url |
| parameters | <code>string</code> | json like {'foo':'bar'} |

**Example**  
```js
var vwu = new Vanilla_website_utils();
filter = {"foo":"bar"};
url = await vwu.add_parameters(url, filter);
```
<a name="exp_module_Vanilla-website-utils--module.exports+afetch_all"></a>

### module.exports#afetch\_all(callback, ...urls) ⇒ <code>array</code> ⏏
This function allows you to call multiple API Get URLs asynchronously and wait for all results.
Once all results are received, an array of JSON object results is returned.

**Kind**: Exported function  
**Returns**: <code>array</code> - - returns 3 nested arrays, main array, counter number and the last nested array includes a JSON object of the actual result  

| Param | Type | Description |
| --- | --- | --- |
| callback | <code>function</code> | The callback function to return the full result |
| ...urls | <code>string</code> | list of URLs, using the spread syntax |

**Example**  
```js
var vwu = new Vanilla_website_utils();
const url = "http://example.com/api/foo"
vwu.aget_api(call_me_back,url, url, url, url);

function call_me_back(msg) {
 console.log(msg);
}
```
<a name="exp_module_Vanilla-website-utils--module.exports+wait_for_all"></a>

### module.exports#wait\_for\_all(...ps) ⇒ <code>promise</code> ⏏
**Kind**: Exported function  
**Returns**: <code>promise</code> - - returns a promise  

| Param | Type | Description |
| --- | --- | --- |
| ...ps | <code>functions</code> | list of functions to process |

**Example**  
```js
this.wait_for_all(...function_array).then((results) => callback(results));
```
<a name="exp_module_Vanilla-website-utils--module.exports+afetch"></a>

### module.exports#afetch(i) ⇒ <code>array</code> ⏏
**Kind**: Exported function  
**Returns**: <code>array</code> - - returns and array with the counter and JSON object result  

| Param | Type | Description |
| --- | --- | --- |
| i | <code>string</code> | url for the GET call |

**Example**  
```js
this.wait_for_all(...function_array).then((results) => callback(results));
```
<a name="exp_module_Vanilla-website-utils--module.exports+handle_rejection"></a>

### module.exports#handle\_rejection(p) ⇒ <code>objet</code> ⏏
**Kind**: Exported function  
**Returns**: <code>objet</code> - - returns an error  

| Param | Type | Description |
| --- | --- | --- |
| p | <code>fuction</code> | promise fuction to process |

**Example**  
```js
//used by the model wait_for all, see above
 wait_for_all(...ps) {
   return Promise.all(ps.map(this.handle_rejection));
 }
```
<a name="exp_module_Vanilla-website-utils--module.exports+aget_api"></a>

### module.exports#aget\_api(url, user, password, token) ⇒ <code>object</code> ⏏
**Kind**: Exported function  
**Returns**: <code>object</code> - json  

| Param | Type | Description |
| --- | --- | --- |
| url | <code>string</code> | api url |
| user | <code>string</code> | user - for Basic Authorization |
| password | <code>string</code> | password - for Basic Authorization |
| token | <code>string</code> | token - for Bearer Authorization |

**Example**  
```js
var vwu = new Vanilla_website_utils();
let res = await vwu.aget_api(url);
```
<a name="exp_module_Vanilla-website-utils--module.exports+aput_api"></a>

### module.exports#aput\_api(url, data, content_type) ⇒ <code>object</code> ⏏
**Kind**: Exported function  
**Returns**: <code>object</code> - json  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| url | <code>string</code> |  | api url |
| data | <code>object</code> |  | data |
| content_type | <code>string</code> | <code>&quot;application/json&quot;</code> | content type of the sending data optional - default is "application/json" |

**Example**  
```js
let data = {"foo":"bar"}
var vwu = new Vanilla_website_utils();
let res = await vwu.apost_api(url, data, "application/json");
```
<a name="exp_module_Vanilla-website-utils--module.exports+apost_api"></a>

### module.exports#apost\_api(url, data, content_type) ⇒ <code>object</code> ⏏
**Kind**: Exported function  
**Returns**: <code>object</code> - json  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| url | <code>string</code> |  | api url |
| data | <code>object</code> |  | data |
| content_type | <code>string</code> | <code>&quot;application/json&quot;</code> | content type of the sending data optional - default is "application/json" |

**Example**  
```js
var vwu = new Vanilla_website_utils();
let res = await vwu.apost_api(url, data, "application/json");
```
<a name="exp_module_Vanilla-website-utils--module.exports+post_api"></a>

### module.exports#post\_api(url, my_callback, _data) ⇒ <code>object</code> ⏏
**Kind**: Exported function  
**Returns**: <code>object</code> - json  

| Param | Type | Description |
| --- | --- | --- |
| url | <code>string</code> | api url |
|  | <code>object</code> | data |
| my_callback | <code>string</code> | name of the callback function |
| _data | <code>string</code> | content type of the sending data optional - default is "application/json" |

**Example**  
```js
var vwu = new Vanilla_website_utils();
let data = {"foo":"bar"}
let ret = vwu.post_api('http://foo.bar/api','myfuncion','application/json') 
```
<a name="exp_module_Vanilla-website-utils--module.exports+_email_validator"></a>

### module.exports#\_email\_validator(email) ⇒ <code>bolan</code> ⏏
**Kind**: Exported function  
**Returns**: <code>bolan</code> - true if ok and false if bad email  

| Param | Type | Description |
| --- | --- | --- |
| email | <code>string</code> | email |

**Example**  
```js
var vwu = new Vanilla_website_utils();
const ok = vwu._email_validator(foo@bar.com)
```
<a name="exp_module_Vanilla-website-utils--module.exports+email_validator"></a>

### module.exports#email\_validator(email) ⇒ <code>bolan</code> ⏏
**Kind**: Exported function  
**Returns**: <code>bolan</code> - true if ok and false if bad email  

| Param | Type | Description |
| --- | --- | --- |
| email | <code>string</code> | email |

**Example**  
```js
var vwu = new Vanilla_website_utils();
const ok = await vwu._email_validator(foo@bar.com)
```
<a name="exp_module_Vanilla-website-utils--module.exports+get_url_parameter"></a>

### module.exports#get\_url\_parameter(name) ⇒ <code>string</code> ⏏
**Kind**: Exported function  
**Returns**: <code>string</code> - url parameter  

| Param | Type | Description |
| --- | --- | --- |
| name | <code>string</code> | key of the url parameter |

**Example**  
```js
var vwu = new Vanilla_website_utils();
const from = await vwu.get_url_parameter('from')
```
<a name="exp_module_Vanilla-website-utils--module.exports+get_site"></a>

### module.exports#get\_site() ⇒ <code>string</code> ⏏
**Kind**: Exported function  
**Returns**: <code>string</code> - sitename  
**Example**  
```js
var vwu = new Vanilla_website_utils();
let site = vwu.get_site
```
<a name="exp_module_Vanilla-website-utils--module.exports+autocomplete_textfield"></a>

### module.exports#autocomplete\_textfield(setting, search) ⏏
**Kind**: Exported function  

| Param | Type | Description |
| --- | --- | --- |
| setting | <code>object</code> | see example |
| search |  | in object can be begining(default) or inline |

**Example**  
```js
var vwu = new Vanilla_website_utils();
 await vwu.autocomplete_textfield({
     url: api + '/code/name',
       onetimeload: true,
       dom_id: 'search',
       name: 'search',
       append_to: '#nav-search',
       min_key_length: 2
       search: inline
     });
     url: api + '/code/name',
       onetimeload: true,
       dom_id: 'search',
       name: 'search',
       append_to: '#nav-search',
       min_key_length: 2
       search: beginning
     });
```
<a name="exp_module_Vanilla-website-utils--module.exports+autocomplete_select"></a>

### module.exports#autocomplete\_select(setting) ⏏
**Kind**: Exported function  

| Param | Type | Description |
| --- | --- | --- |
| setting | <code>object</code> | see example |

**Example**  
```js
var vwu = new Vanilla_website_utils();
 await vwu.autocomplete_select({
     url: api + '/code/name',
       onetimeload: true,
       dom_id: 'search',
       name: 'search',
     });
```
<a name="exp_module_Vanilla-website-utils--module.exports+_set_textfield"></a>

### module.exports#\_set\_textfield() ⏏
**Kind**: Exported function  
<a name="exp_module_Vanilla-website-utils--module.exports+autoload_textfield"></a>

### module.exports#autoload\_textfield() ⏏
**Kind**: Exported function  
<a name="exp_module_Vanilla-website-utils--module.exports+autocomplete"></a>

### module.exports#autocomplete() ⏏
**Kind**: Exported function  
<a name="exp_module_Vanilla-website-utils--module.exports+post_textfield_rows"></a>

### module.exports#post\_textfield\_rows(id, url, callback) ⇒ <code>callback</code> ⏏
**Kind**: Exported function  
**Returns**: <code>callback</code> - - callback call  

| Param | Type | Description |
| --- | --- | --- |
| id | <code>string</code> | id from a enbedded Textfield into a form tag |
| url | <code>string</code> | url string where to post the data rows |
| callback | <code>string</code> | callback function, you need to declare a callbackup what will be called after the post |

**Example**  
```js
it will disable the form submit 
var vwu = new Vanilla_website_utils();
let array= vwu.get_text_rows);
```
<a name="exp_module_Vanilla-website-utils--module.exports+get_form_data"></a>

### module.exports#get\_form\_data(form) ⇒ <code>array</code> ⏏
**Kind**: Exported function  
**Returns**: <code>array</code> - in key/value as JSON  

| Param | Type | Description |
| --- | --- | --- |
| form | <code>object</code> | form object |

**Example**  
```js
var vwu = new Vanilla_website_utils();
let data = JSON.stringify(await vwu.get_form_data(form));
```
<a name="exp_module_Vanilla-website-utils--module.exports+s_fill_select"></a>

### module.exports#s\_fill\_select(select_obj, data) ⏏
**Kind**: Exported function  

| Param | Type | Description |
| --- | --- | --- |
| select_obj | <code>object</code> | DOM object |
| data | <code>object</code> | data array |

**Example**  
```js
var vwu = new Vanilla_website_utils();
 let extra_sel = document.querySelector("#extra");
 await vwu.fill_select(extra_sel, data);
```
<a name="exp_module_Vanilla-website-utils--module.exports+fill_select"></a>

### module.exports#fill\_select(select_obj, data, selected, copy2clipboard, log) ⏏
**Kind**: Exported function  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| select_obj | <code>object</code> |  | DOM object |
| data | <code>object</code> |  | data array |
| selected | <code>string</code> |  | select element |
| copy2clipboard | <code>boolean</code> | <code>false</code> | copy2clipboard true or false |
| log | <code>object</code> | <code>false</code> | log object - experimental |

**Example**  
```js
var vwu = new Vanilla_website_utils();
const url = api + '/fields?table=av0_style&db=sl&server=232&f=list';
const data = JSON.parse(await aget_api(url));
let extra_sel = document.querySelector("#extra");
await vwu.fill_select(extra_sel, data);
await vwu.fill_select(sel,all_tags,'height: 500px; width: 230px;font-size: 9px',true, log);
```
<a name="exp_module_Vanilla-website-utils--module.exports+pad"></a>

### module.exports#pad(number) ⇒ <code>string</code> ⏏
**Kind**: Exported function  
**Returns**: <code>string</code> - - data array  

| Param | Type | Description |
| --- | --- | --- |
| number | <code>int</code> | number |

**Example**  
```js
var vwu = new Vanilla_website_utils();
 let x = vwu.pad(5);
```
<a name="exp_module_Vanilla-website-utils--module.exports+s_set_selected"></a>

### module.exports#s\_set\_selected(select_obj, data) ⏏
**Kind**: Exported function  

| Param | Type | Description |
| --- | --- | --- |
| select_obj | <code>object</code> | DOM object |
| data | <code>object</code> | data array |

**Example**  
```js
var vwu = new Vanilla_website_utils();
 let extra_sel = document.querySelector("#extra");
 await vwu.fill_select(extra_sel, data);
```
<a name="exp_module_Vanilla-website-utils--module.exports+set_selected"></a>

### module.exports#set\_selected() ⏏
**Kind**: Exported function  
**Example**  
```js
var vwu = new Vanilla_website_utils(); 
let select = document.querySelector("#bom");
await vwu.set_selected(select,v['bom']);
```

---
_Source: https://npm.io/package/vanilla-website-utils · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
