# blob

Creates a blob schema.

> The `Blob` class is not available by default in Node.js v16 and below.

```ts
const Schema = v.blob<TMessage>(message);
```

## Generics

- `TMessage` <Property {...properties.TMessage} />

## Parameters

- `message` <Property {...properties.message} />

### Explanation

With `blob` you can validate the data type of the input. If the input is not a blob, you can use `message` to customize the error message.

## Returns

- `Schema` <Property {...properties.Schema} />

## Examples

The following examples show how `blob` can be used.

### Image schema

Schema to validate an image.

```ts
const ImageSchema = v.pipe(
  v.blob('Please select an image file.'),
  v.mimeType(['image/jpeg', 'image/png'], 'Please select a JPEG or PNG file.'),
  v.maxSize(1024 * 1024 * 10, 'Please select a file smaller than 10 MB.')
);
```

## Related

The following APIs can be combined with `blob`.

### Schemas

<ApiList
  items={[
    'array',
    'exactOptional',
    'intersect',
    'lazy',
    'looseObject',
    'looseTuple',
    'map',
    'nonNullable',
    'nonNullish',
    'nonOptional',
    'nullable',
    'nullish',
    'object',
    'objectWithRest',
    'optional',
    'record',
    'set',
    'strictObject',
    'strictTuple',
    'tuple',
    'tupleWithRest',
    'undefinedable',
    'union',
  ]}
/>

### Methods

<ApiList
  items={[
    'assert',
    'config',
    'fallback',
    'getDefault',
    'getDefaults',
    'getFallback',
    'getFallbacks',
    'is',
    'message',
    'parse',
    'parser',
    'pipe',
    'safeParse',
    'safeParser',
  ]}
/>

### Actions

<ApiList
  items={[
    'check',
    'brand',
    'description',
    'flavor',
    'guard',
    'maxSize',
    'metadata',
    'mimeType',
    'minSize',
    'notSize',
    'rawCheck',
    'rawTransform',
    'readonly',
    'size',
    'title',
    'transform',
  ]}
/>

### Utils

<ApiList items={['entriesFromList', 'isOfKind', 'isOfType']} />
