New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@c8/base-service

Package Overview
Dependencies
Maintainers
6
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@c8/base-service

A base service package that defines basic methods on the service layer

  • 0.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
6
Weekly downloads
 
Created
Source

base-service

A base service package that implements Base Model on the service layer

What it does

Adds base model instance in the service exposing it for use.

Installation

npm install @c8/base-service

Examples

BaseService requires a valid model instance to be passed in the constructor Throws Must pass a valid initialized base model instance Error if no valid BaseModel instance passed Exposes this.model property.

// my-service/index.js

const MyModel = require('../models/my-model')
const BaseService = require('@c8/base-service')

class MyService extends BaseService {

}

module.exports = new MyService(MyModel)

In case you need to extend the service:

class MyService extends BaseService {

    static insert(clause) {
        return this.model.insert(clause)
    }
}

NOTE: The methods you call with this.model.{method}() when extending the base service HAVE to be defined in your model.

Keywords

FAQs

Package last updated on 23 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc