@delucis/reading-data-omit

0.1.1 • Public • Published

@delucis/reading-data-omit

Build Status Coverage Status npm (scoped)

A plugin for @delucis/reading-data that allows easy use of lodash.omit.

Installation

npm install --save @delucis/reading-data-omit

Usage

const RD = require('@delucis/reading-data')
const OMIT = require('@delucis/reading-data-omit')

RD.preloadData({
  myArticle: {
    text: 'This is a short article that is well worth reading.',
    meta: 'This is some superfluous metadata we’d rather not include'
  }
})

RD.use(OMIT, {
  scope: 'myArticle',
  omit: 'meta'
})

RD.run().then((res) => {
  console.log(res.data.myArticle)
  // logs: { text: 'This is a short article that is well worth reading.' }
})

Options

name type default description
hooks String, Object 'process' The reading-data hook that should process the scope, omitting keys. Can be scoped by passing an object with scopes as keys, hooks as values.
omit String, Array The property/properties to be omitted from the original data.
scope String, Array 'omit' The scope under which reading-data will store this plugin’s data.

Readme

Keywords

none

Package Sidebar

Install

npm i @delucis/reading-data-omit

Weekly Downloads

0

Version

0.1.1

License

GPL-3.0

Last publish

Collaborators

  • delucis