Socket
Socket
Sign inDemoInstall

vlserver

Package Overview
Dependencies
125
Maintainers
1
Versions
220
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    vlserver

VLServer Managed Server


Version published
Weekly downloads
210
increased by1515.38%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

npm version vlquery

vlserver API Binder

vlserver automates api interfaces by automatically binding Services and ViewModels from the server to one or multiple clients.

This package requires vlquery.

Documentation

Getting Started
Adapters
Data Exchange

Sponsoring and support

This project is sponsored and supported by inter allied crypsis / ACRYPS and VLVT.IN GmbH.

Example

Declare view models on the server

export class AuthorViewModel extends ViewModel<Person> {
	id;

	firstname;
	lastname;
}

export class BookViewModel extends ViewModel<Book> {
	id;

	name;
	author: AuthorViewModel;
}

Create a service on the server

export class BookService extends Service {
	constructor(
		private db: DbContext
	) {
		super();
	}

	getBooks() {
		return BookViewModel.from(this.db.book);
	}
}

You can use the service in your client (after generating the bindings with vlserver compile)

const service = new BookService();
service.getBooks().then(books => {
	console.log(books); // [ BookViewModel, BookViewModel, ... ]
});

Keywords

FAQs

Last updated on 11 Jan 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc