recursal/MDN huggingface dataset:
FileSystemDirectoryHandle: values() method
==========================================

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

 The **`values()`** method of the
 `FileSystemDirectoryHandle` interface returns a new asynchronous iterator
 for the iteration of the value of the entries within the `FileSystemDirectoryHandle`
 on which this method is called.

Syntax
------


```js
values()
```

### Parameters

None.

### Return value

A new asynchronous iterator containing the handles of each entry within the `FileSystemDirectoryHandle`.

### Exceptions

`NotAllowedError` `DOMException`

Thrown if the `PermissionStatus.state` for the handle is not `'granted'` in `read` mode.

`NotFoundError` `DOMException`

Thrown if the current entry is not found.

Examples
--------

Use the `for await...of` loop can simplify the iteration process.


```js
const dirHandle = await window.showDirectoryPicker();

for await (const value of dirHandle.values()) {
  console.log(value);
}
```

Specifications
--------------

| Specification |
| --- |
| File System Standard # api-filesystemdirectoryhandle-asynciterable |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* File System API
* The File System Access API: simplifying access to local files
Blob: text() method
===================

**Note:** This feature is available in Web Workers

 The **`text()`** method of the
 `Blob` interface returns a `Promise` that resolves with a
 string containing the contents of the blob, interpreted as UTF-8.

Syntax
------


```js
text()
```

### Parameters

None.

### Return value

 A promise that resolves with a string which contains the blob's data
 as a text string. The data is *always* presumed to be in UTF-8 format.

Usage notes
-----------

 The `FileReader` method `readAsText()` is an older method that performs a similar function. It works on both
 `Blob` and `File` objects. There are two key differences:

* `Blob.text()` returns a promise, whereas
 `FileReader.readAsText()` is an event based API.
* `Blob.text()` always uses UTF-8 as encoding, while
 `FileReader.readAsText()` can use a different encoding depending on the
 blob's type and a specified encoding name.
Specifications
--------------

| Specification |
| --- |
| File API # dom-blob-text |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `Response.text()`
* Streams API
* `FileReader.readAsText()`
Blob: size property
===================

**Note:** This feature is available in Web Workers

 The **`size`** read-only property of the `Blob` interface returns
 the size of the `Blob` or `File` in bytes.

Value
-----

 The number of bytes of data contained within the `Blob` (or
 `Blob`-based object, such as a `File`).

Examples
--------

 This example uses an `<input>` element of type `file` to ask
 the user for a group of files, then iterates over those files outputting their names and
 lengths in bytes.

### HTML


```html
<input type="file" id="input" multiple />
<output id="output">Choose files…</output>
```


```
output {
  display: block;
  margin-top: 16px;
}
```

### JavaScript


```js
const input = document.getElementById("input");
const output = document.getElementById("output");

input.addEventListener("change", (event) => {
  output.innerText = "";

  for (const file of event.target.files) {
    output.innerText += `${file.name} has a size of ${file.size} bytes.\n`;
  }
});
```

### Result

Specifications
--------------

| Specification |
| --- |
| File API # dfn-size |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `Blob`
* Using files from web applications
Blob: Blob() constructor
========================

**Note:** This feature is available in Web Workers

 The **`Blob()`** constructor returns a
 new `Blob` object. The content of the blob consists of the concatenation
 of the values given in the parameter `array`.

Syntax
------


```js
new Blob(blobParts)
new Blob(blobParts, options)
```

### Parameters

`blobParts` Optional

 An iterable
 object such as an `Array`, having `ArrayBuffer`s,
 `TypedArray`s, `DataView`s, `Blob`s, strings,
 or a mix of any of such elements, that will be put inside the `Blob`.
 Strings should be well-formed Unicode, and lone surrogates are sanitized using the same algorithm as `String.prototype.toWellFormed()`.


`options` Optional

An object which may specify any of the following properties:

`type` Optional

 The MIME type of the data that will be stored into the blob. The
 default value is the empty string, (`""`).


`endings` Optional

 How to interpret newline characters (`\n`) within the contents, if
 the data is text. The default value, `transparent`, copies newline
 characters into the blob without changing them. To convert newlines to the host
 system's native convention, specify the value `native`.



### Return value

A new `Blob` object containing the specified data.

Examples
--------


```js
const array = ['<q id="a"><span id="b">hey!</span></q>']; // an array consisting of a single string
const blob = new Blob(array, { type: "text/html" }); // the blob
```

Specifications
--------------

| Specification |
| --- |
| File API # constructorBlob |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
Blob: arrayBuffer() method
==========================

**Note:** This feature is available in Web Workers

 The **`arrayBuffer()`** method of the `Blob`
 interface returns a `Promise` that resolves with the contents of the blob as
 binary data contained in an `ArrayBuffer`.

Syntax
------


```js
arrayBuffer()
```

### Parameters

None.

### Return value

 A promise that resolves with an `ArrayBuffer` that contains the blob's
 data in binary form.

### Exceptions

 While this method doesn't throw exceptions, it may reject the promise. This can happen,
 for example, if the reader used to fetch the blob's data throws an exception. Any
 exceptions thrown while getting the data will be converted into rejections.

Usage notes
-----------

 While similar to the `FileReader.readAsArrayBuffer()` method,
 `arrayBuffer()` returns a promise rather than being an event-based API, as is
 the case with the `FileReader` interface's method.

Specifications
--------------

| Specification |
| --- |
| File API # dom-blob-arraybuffer |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `Response.arrayBuffer()`
* Streams API
* `FileReader.readAsArrayBuffer()`
Blob: stream() method
=====================

**Note:** This feature is available in Web Workers

The **`stream()`** method of the `Blob` interface returns a `ReadableStream` which upon reading returns the data contained within the `Blob`.

Syntax
------


```js
stream()
```

### Parameters

None.

### Return value

 A `ReadableStream` which, upon reading, returns the contents of the
 `Blob`.

Usage notes
-----------

 With `stream()` and the returned `ReadableStream`, you gain
 several interesting capabilities:

* Call `getReader()` on the returned stream
 to get an object to use to read the data from the blob using methods such as the
 `ReadableStreamDefaultReader` interface's
 `read()` method.
* Call the returned stream's `pipeTo()` method
 to pipe the blob's data to a writable stream.
* Call the returned stream's `tee()` method to
 **tee** the readable stream. This returns an array containing two new
 `ReadableStream` objects, each of which returns the contents of the
 `Blob`.
* Call the returned stream's `pipeThrough()` method to pipe the stream through a `TransformStream`
 or any other readable and writable pair.
Specifications
--------------

| Specification |
| --- |
| File API # dom-blob-stream |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `Response.body`
* Streams API
Blob: slice() method
====================

**Note:** This feature is available in Web Workers

 The **`slice()`** method of the `Blob` interface
 creates and returns a new `Blob` object which contains data from a subset of
 the blob on which it's called.

Syntax
------


```js
slice()
slice(start)
slice(start, end)
slice(start, end, contentType)
```

### Parameters

`start` Optional

 An index into the `Blob` indicating the first byte to include in the
 new `Blob`. If you specify a negative value, it's treated as an offset
 from the end of the `Blob` toward the beginning. For example, -10 would
 be the 10th from last byte in the `Blob`. The default value is 0. If you
 specify a value for `start` that is larger than the size of the source
 `Blob`, the returned `Blob` has size 0 and contains no data.


`end` Optional

 An index into the `Blob` indicating the first byte that will *not* be
 included in the new `Blob` (i.e. the byte exactly at this index is not
 included). If you specify a negative value, it's treated as an offset from the end of
 the `Blob` toward the beginning. For example, -10 would be the 10th from
 last byte in the `Blob`. The default value is `size`.


`contentType` Optional

 The content type to assign to the new `Blob`; this will be the value of
 its `type` property. The default value is an empty string.


### Return value

 A new `Blob` object containing the specified subset of the data contained
 within the blob on which this method was called. The original blob is not altered.

Specifications
--------------

| Specification |
| --- |
| File API # dfn-slice |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `Blob`
* Using files from web applications
Blob: type property
===================

**Note:** This feature is available in Web Workers

The **`type`** read-only property of the `Blob` interface returns the MIME type of the file.

**Note:** Based on the current implementation, browsers won't actually read the bytestream of a file to determine its media type.
 It is assumed based on the file extension; a PNG image file renamed to .txt would give "*text/plain*" and not "*image/png*". Moreover, `blob.type` is generally reliable only for common file types like images, HTML documents, audio and video.
 Uncommon file extensions would return an empty string.
 Client configuration (for instance, the Windows Registry) may result in unexpected values even for common types. **Developers are advised not to rely on this property as a sole validation scheme.**

Value
-----

 A string containing the file's MIME type, or an empty string if the
 type could not be determined.

Examples
--------

 This example asks the user to select a number of files, then checks each file to make
 sure it's one of a given set of image file types.

### HTML


```html
<input type="file" id="input" multiple />
<output id="output">Choose image files…</output>
```


```
output {
  display: block;
  margin-top: 16px;
}
```

### JavaScript


```js
// Our application only allows GIF, PNG, and JPEG images
const allowedFileTypes = ["image/png", "image/jpeg", "image/gif"];

const input = document.getElementById("input");
const output = document.getElementById("output");

input.addEventListener("change", (event) => {
  const files = event.target.files;

  if (files.length === 0) {
    output.innerText = "Choose image files…";
    return;
  }

  const allAllowed = Array.from(files).every((file) =>
    allowedFileTypes.includes(file.type),
  );
  output.innerText = allAllowed
    ? "All files clear!"
    : "Please choose image files only.";
});
```

### Result

Specifications
--------------

| Specification |
| --- |
| File API # dfn-type |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `Blob`
* Using files from web applications
ContactAddress: country property
================================

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

The **`country`** read-only property of the `ContactAddress` interface is a string identifying the address's country using the ISO 3166-1 alpha-2 standard. The string is always in its canonical upper-case form.

Some examples of valid `country` values: `"US"`, `"GB"`, `"CN"`, or `"JP"`.

Value
-----

A string which contains the ISO3166-1 alpha-2 code identifying the country in which the address is located, or an empty string if no country is available, which frequently can be assumed to mean "same country as the site owner."

Specifications
--------------

| Specification |
| --- |
| Contact Picker API # dom-contactaddress-country |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
ContactAddress: organization property
=====================================

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

The **`organization`** read-only property of the `ContactAddress` interface returns a string containing the name of the organization, firm, company, or institution at the address.

Value
-----

A string whose value is the name of the organization or company located at the address described by the `ContactAddress` object.

Specifications
--------------

| Specification |
| --- |
| Contact Picker API # dom-contactaddress-organization |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
ContactAddress: addressLine property
====================================

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

The **`addressLine`** read-only property of the `ContactAddress` interface is an array of strings, each specifying a line of the address that is not covered by one of the other properties of `ContactAddress`. The array may include the street name, the house number, apartment number, the rural delivery route, descriptive instructions, or the post office box.

Value
-----

An array of strings, each containing one line of the address. For example, the `addressLine` property for the Mozilla Space in London would have the following entries:

| Index | addressLine[] value |
| --- | --- |
| 0 | Metal Box Factory |
| 1 | Suite 441, 4th floor |
| 2 | 30 Great Guildford Street |

These, combined with additional values for other properties of the `ContactAddress`, would represent the full address, which is:


```plaintext
Mozilla
Metal Box Factory
Suite 441, 4th floor
30 Great Guildford Street
London SE1 0HS
United Kingdom
```

Specifications
--------------

| Specification |
| --- |
| Contact Picker API # dom-contactaddress-addressLine |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
ContactAddress: recipient property
==================================

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

The read-only **`recipient`** property of the `ContactAddress` interface returns a string containing the name of the recipient, purchaser, or contact person at the address.

Value
-----

A string giving the name of the person=, or the name of a contact person in other contexts. If no name is available, this string is empty.

Specifications
--------------

| Specification |
| --- |
| Contact Picker API # dom-contactaddress-recipient |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
ContactAddress: city property
=============================

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

The **`city`** read-only property of the `ContactAddress` interface returns a string containing the city or town portion of the address.

Value
-----

A string indicating the city or town portion of the address described by the `ContactAddress` object.

Specifications
--------------

| Specification |
| --- |
| Contact Picker API # dom-contactaddress-city |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
ContactAddress: toJSON() method
===============================

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

The **`toJSON()`** method of the `ContactAddress` interface is a standard serializer that returns a JSON representation of the `ContactAddress` object's properties.

Syntax
------


```js
toJSON()
```

### Return value

A JSON object.

Specifications
--------------

| Specification |
| --- |
| Contact Picker API # dom-contactaddress-toJSON |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
ContactAddress: region property
===============================

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

The read-only **`region`** property of the `ContactAddress` interface returns a string containing the top-level administrative subdivision of the country in which the address is located. This may be a state, province, oblast, or prefecture.

Value
-----

A string specifying the top-level administrative subdivision within the country in which the address is located. This region has different names in different countries, such as: state, province, oblast, prefecture, or county.

Usage notes
-----------

In some countries, like Belgium, it's uncommon for people to provide a region as part of their postal address. In such cases, the browser returns an empty string as the value of `region`. However, the address should still be acceptable to use for its intended purpose (e.g., to ship a product). However, always verify addresses to make sure what the user provides is usable.

Specifications
--------------

| Specification |
| --- |
| Contact Picker API # dom-contactaddress-region |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
ContactAddress: postalCode property
===================================

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

The **`postalCode`** read-only property of the `ContactAddress` interface returns a string containing a code used by a jurisdiction for mail routing, for example, the ZIP Code in the United States or the Postal Index Number (PIN code) in India.

Value
-----

A string which contains the postal code portion of the address. A postal code is a string (either numeric or alphanumeric) which is used by a postal service to optimize mail routing and delivery.

Various countries use different terms for this. In most of the world, it's known as the "post code" or "postal code". In the United States, the ZIP code is used. India uses PIN codes.

Specifications
--------------

| Specification |
| --- |
| Contact Picker API # dom-contactaddress-postalCode |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Universal Postal Union: Universal Post\*Code® Database
ContactAddress: phone property
==============================

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

The read-only **`phone`** property of the `ContactAddress` interface returns a string containing the telephone number of the recipient or contact person at the address.

Value
-----

A string containing the telephone number for the recipient of the shipment. If no phone number is available, this value is an empty string.

Specifications
--------------

| Specification |
| --- |
| Contact Picker API # dom-contactaddress-phone |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
ContactAddress: dependentLocality property
==========================================

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

The read-only **`dependentLocality`** property of the `ContactAddress` interface is a string containing a locality or sublocality designation within a city, such as a neighborhood, borough, district, or, in the United Kingdom, a dependent locality. Also known as a *post town*.

Value
-----

A string indicating the sublocality portion of the address. This may be an empty string if no sublocality is available or required. It's used to provide disambiguation when a city may include areas that duplicate street names.

A sublocality is an area within a city, such as a neighborhood, borough, or district. In the United Kingdom, this is used to indicate the **post town** in the United Kingdom (known officially by the Royal Mail as the **dependent locality**). This is a disambiguating feature of addresses in places where a city may have areas that duplicate street names.

Specifications
--------------

| Specification |
| --- |
| Contact Picker API # dom-contactaddress-dependentLocality |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
ContactAddress: sortingCode property
====================================

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

The **`sortingCode`** read-only property of the `ContactAddress` interface returns a string containing a postal sorting code such as is used in France.

Value
-----

A string containing the sorting code portion of the address.

Specifications
--------------

| Specification |
| --- |
| Contact Picker API # dom-contactaddress-sortingCode |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.