# se-expiry

> A simple wrapper to get the list of .se domains expiring soon.

Latest version **0.2.0** (published 2019-03-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install se-expiry
pnpm add se-expiry
yarn add se-expiry
bun add se-expiry
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2019-03-16 |
| First published | 2019-03-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | devmaximilian |
| Maintainers | devmaximilian |
| Keywords | se, tld, expiry, wrapper, javascript |

## Links

- npm: https://www.npmjs.com/package/se-expiry
- Repository: https://github.com/devmaximilian/se-expiry
- Homepage: https://github.com/devmaximilian/se-expiry#readme
- Issues: https://github.com/devmaximilian/se-expiry/issues
- npm.io page: https://npm.io/package/se-expiry

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 0.2.0 (latest) — 2019-03-16
- 0.1.0 — 2019-03-10

## README

# SE Expiry

A simple wrapper to get the list of `.se` domains expiring soon. Built with Promises in mind.

Data fetched from [Internetstiftelsen](https://internetstiftelsen.se/).

### Example usage

#### Simple usage example

```javascript
const expiry = require('se-expiry');

expiry
  .load()
  .then(domains => {
    // Do something
  })
  .catch(error => {
    // Handle error
  });
```

#### Manual usage example

```javascript
const expiry = require('se-expiry');

expiry
  .fetch()
  .then(data => {
    expiry
      .parse(data)
      .then(domains => {
        // Do something
      })
      .catch(error => {
        // Handle parse error
      });
  })
  .catch(error => {
    // Handle fetch error
  });
```

### Documentation

Any functions/methods prefixed with an underscore are not intended to be called manually.

#### Class: Domain

```javascript
class Domain {

  // Class constructor
  constructor(:name = String, :expires = Date)

}
```

#### Class: Domains (collection)

```javascript
class Domains {

  // Class constructor
  constructor(:items = [Domain])

  // Sorting function (sorts by date)
  _byDate(:a = Domain, :b = Domain) // => Bool

  // Sorting function (sorts by name length)
  _byLength(:a = Domain, :b = Domain) // => Bool

  // Sort interface (called by order method)
  _sort(:by = Function) // => Promise

  // Order method (by accepts 'date' or 'length', fallback is 'date')
  order(:by = String) // => Promise
}
```

#### Function: fetch

```javascript
// Fetch function (https fallback is true)
fetch(:https = Bool) // => Promise
```

#### Function: parse

```javascript
// Parse function (https fallback is true)
fetch(:raw = String) // => Promise
```

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