open-index/open-npm huggingface dataset:
npm package: @laran/lightpages-cli
Description: CLI to build and manage LightPages indices
Author: Laran Evans
Latest version: 1.0.44

# lightpages

lightpages-cli needs to be installed globally so that the command line script is available on the path.

npm -i -g lightpages-cli

## Managing/building the local index

lightpages --help

lightpages index-pages
npm package: @laranatech/schemer
Description: Bare minimum validation tool
Author: Evgenii Kucheriavyi
Latest version: 1.0.6

# LaranaTech: Schemer

This is a bare minimum validation tool for js.

## Installation

```bash
npm install @laranatech/schemer
```

See [@laranatech/schemer](https://www.npmjs.com/package/@laranatech/schemer) on npm.

## Examples

### Importing

```js
// Browser
import { rules, Schemer } from '@laranatech/schemer'

// Node.js
const { rules, Schemer } = require('@laranatech/schemer')

```

### Validate a value

```js
const { validate, rules } = require('@laranatech/schemer')

// returns `true` if value is valid
// throws an error otherwise
validate(20, {
	type: 'int',
	rules: [
		rules.max(100),
		rules.min(10),
	],
})

validate([1, 2, 3], {
	type: ['int'], // validating an array
	rules: [
		rules.positive(),
	],
})

// type shorthands
validate(value, 'int')
validate([value], ['int'])

```

### Safe validation

Value can be validated without throwing an error

```js
const { success, errors } = validateSafely(10.1, 'int')

console.log(errors) // ['Error: Value must be integer: 10.1']

```

### Validate an objects

```js
const { Schemer, rules, common } = require('@laranatech/schemer')

const s = new Schemer({
	id: {
		type: 'string',
		rules: [
			rules.regexp(/\d\d\d-\d\d\d/),
		],
	},
	x: 'int',
	y: common.positiveInt,
	name: {
		type: 'string',
		nullable: true,
	},
	email: {
		...common.email,
		required: false,
	},
})

s.validate({
	x: undefined,
	y: 10,
	name: null,
	email: 'e@vgenii.ru',
})

// Error: value must be integer: undefined

```