the-site-resources

2.3.12 • Public • Published

the-site-resources

Build Status npm Version JS Standard

Resources for site

Installation

$ npm install the-site-resources --save

Usage

'use strict'
 
const {TheAliasResource} = require('the-site-resources')
const theDB = require('the-db')
 
async function tryExample () {
  const db = theDB({/* ... */})
 
  // Load resource classes
  {
    class Alias extends TheAliasResource {
 
    }
 
    db.load(Alias, 'Alias')
  }
 
  // Use resource instances
  {
    const {Alias} = db.resources
    const alias = await Alias.ofUrl(`http://example.com/foo/bar`)
    /* ... */
  }
 
}
 
tryExample().catch((err) => console.error(err))
 

API Guide

License

This software is released under the MIT License.

Links

/the-site-resources/

    Package Sidebar

    Install

    npm i the-site-resources

    Weekly Downloads

    1

    Version

    2.3.12

    License

    MIT

    Unpacked Size

    493 kB

    Total Files

    51

    Last publish

    Collaborators

    • okunishinishi