Wondering what’s next for npm?Check out our public roadmap! »

@seneca/entity-utilTypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

seneca-entity-util

Npm Travis Coveralls DeepScan grade Maintainability devDependencies Status

Utilities for Seneca entities.

  • rtag: random revision tags generated per save; provides support for complex object caching.
  • archive: archival of deleted entities.
  • when: injection of created and modified time stamps
  • duration: injection of entity action duration times in results as meta data

Install

$ npm install seneca-entity-util seneca-promisify

Options

  • rtag.active : boolean false
  • rtag.field : string "rtag"
  • rtag.len : number 17
  • rtag.annotate : boolean true
  • rtag.stats : boolean true
  • rtag.clone_before_hydrate : boolean true
  • when.active : boolean false
  • when.field_created : string "t_c"
  • when.field_modified : string "t_m"
  • duration.active : boolean false
  • duration.annotation : string "d$"
  • duration.stats : boolean true
  • archive.active : boolean false
  • archive.entity : string "sys/archive"
  • archive.custom_props : array
  • derive.active : boolean false

Set plugin options when loading with:

 
 
seneca.use('entity-util', { name: value, ... })
 
 

Note: foo.bar in the list above means { foo: { bar: ... } }

Action Patterns

Action Descriptions

« role:cache,resolve:rtag »

Use rtag to load cached version of expensive result.

Parameters

  • space : string " "
  • key : string " "
  • rtag : string " "
  • resolver : function " "

« role:cache,stats:rtag »

Get rtag cache usage statistics.


« role:entity,cmd:list »

No description provided.


« role:entity,cmd:load »

No description provided.


« role:entity,cmd:remove »

No description provided.


« role:entity,cmd:save »

Override role:entity,cmd:save to apply utilities.


« sys:entity,derive:add »

No description provided.


« sys:entity,derive:list »

No description provided.


Install

npm i @seneca/entity-util

DownloadsWeekly Downloads

11

Version

1.2.0

License

MIT

Unpacked Size

45.3 kB

Total Files

13

Last publish

Collaborators

  • avatar
  • avatar