📄 | .gitignore |
📄 | README.md |
📄 | command.js |
📄 | connect.js |
📄 | createClient.js |
📄 | createServer.js |
📁 | example |
📄 | index.js |
📄 | listen.js |
📄 | package.json |
📄 | serialize.js |
📁 | test |
📄 | walkApi.js |
vas
simple composable data services using muxrpc
work in progress
npm install --save ahdinosaur/vas
for a user interface complement, see inu
example
see ./example
usage
a vas
service is a definition for a duplex stream that could respond to requests.
a vas
service is defined by an object with the following keys:
name
: a string nameversion
(optional): a string semantic versionmanifest
: an object muxrpc manifestpermissions
: an object muxrpc permissionsinit
: ainit(server, config)
pure function that returns an object of method functions to pass intomuxrpc
services
: any recursive sub-services of this one
vas = require('vas')
the top-level vas
module is a grab bag of all vas/*
modules.
you can also require each module separately like require('vas/createServer')
.
server = vas.createServer(service, config)
a vas
server is an instantiation of a service that responds to requests.
returns a vas
server defined by an object with the following keys:
name
: a string nameversion
(optional): a string semantic versionmanifest
: an objectmuxrpc
manifestpermissions
: an objectmuxrpc
permissionsmethods
: pure functions that are wrapped bymuxrpc
services
: any recursive services within this service
server.createStream()
returns a duplex pull stream using muxrpc
vas.listen(server, options)
listens to a port and begins to handle requests from clients using pull-ws-server
vas.command(server, options)
run a command on a server as a command-line interface using muxrpcli
client = vas.createClient(manifest, config)
a vas
client is a composition of manifests to makes requests.
name
: a string nameversion
(optional): a string semantic versionmanifest
: an object muxrpc manifestservices
: any recursive services within this service
client.createStream()
returns a duplex pull stream using muxrpc
vas.connect(client, options)
connects the client to a server over websockets using pull-ws-server
inspiration
license
The Apache License
Copyright © 2016 Michael Williams
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Built with git-ssb-web