Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

harcon-radiation

Package Overview
Dependencies
Maintainers
1
Versions
235
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

harcon-radiation - npm Package Compare versions

Comparing version 0.8.0 to 1.0.0

2

lib/harcon-radiation.js

@@ -6,3 +6,3 @@ var ES6 = require('./ES6Fixer');

var VERSION = exports.VERSION = '0.8.0';
var VERSION = exports.VERSION = '1.0.0';
function extend(obj, extension){

@@ -9,0 +9,0 @@ for(var key in extension){

{
"name": "harcon-radiation",
"version": "0.8.0",
"version": "1.0.0",
"description": "REST and Websocket plugin for harcon",

@@ -33,3 +33,3 @@ "keywords": [

"connect-rest": "~1",
"harcon": "~1",
"harcon": "~2",
"socket.io": "~1"

@@ -55,3 +55,3 @@ },

},
"_id": "harcon-radiation@0.8.0"
"_id": "harcon-radiation@1.0.0"
}

@@ -1,2 +0,2 @@

Harcon-Radiation - An extension to the [harcon](https://github.com/imrefazekas/harcon) library to automatically expose entities through REST and Websocket.
Harcon-Radiation - An extension to the [harcon](https://github.com/imrefazekas/harcon) library to automatically expose selected entities through REST and/or Websocket.

@@ -9,3 +9,3 @@ [![NPM](https://nodei.co/npm/harcon-radiation.png)](https://nodei.co/npm/harcon-radiation/)

Every time you publish or revoke an object-based entity, the [harcon-radiation](https://github.com/imrefazekas/harcon-radiation) will maintain the interfaces transparently.
Every time you publish or revoke an object-based entity, the [harcon-radiation](https://github.com/imrefazekas/harcon-radiation) reacts to the changes and maintain the interfaces transparently.

@@ -18,8 +18,10 @@ ## Installation

```javascript
var inflicter = new Inflicter( { ... } );
var radiation = new Radiation( inflicter );
var harcon = new Harcon( { ... } );
var radiation = new Radiation( harcon );
var rest = require('connect-rest');
var connect = require('connect');
...
var app = connect();
...
app.use( radiation.rester( options ) ); // Activates the REST services
app.use( radiation.rester( rest, options ) ); // Activates the REST services
...

@@ -29,3 +31,3 @@ server = http.createServer(app);

...
inflicter.addicts( {
harcon.addicts( {
name: 'julie',

@@ -40,7 +42,30 @@ context: 'book',

```
The example shows how you can attach the __radiation__ to a connect/express instance. You can activate the REST and Websocket interfaces or both as you wish.
The example shows how you can attach the __radiation__ to a connect/express instance and link to your _harcon_ instance. You can activate the REST and Websocket interfaces only or both as you wish.
Any object-based entities published to [harcon](https://github.com/imrefazekas/harcon) possessing attributes __'rest'__ and __'websocket'__ will be exposed through those interfaces automatically.
## Access service functions
## Regulate publishing process
The default behavior is to publish all services. However, one can define rules to make exceptions. By setting the option _hideInnerServices_, [harcon-radiation](https://github.com/imrefazekas/harcon-radiation) will hide inner services and won't publish them
```javascript
var radiation = new Radiation( harcon, { hideInnerServices: true } );
```
[harcon-radiation](https://github.com/imrefazekas/harcon-radiation) ignores a service in 2 cases:
- its name starts with a given prefix
```javascript
var radiation = new Radiation( harcon, { hideInnerServices: true, innerServicesPrefix: '_' } );
```
- its name matches to a given pattern
```javascript
var radiation = new Radiation( harcon, { hideInnerServices: true, innerServicesFn: function(name){
return name.startsWith('inner') || name.startsWith('sys');
} } );
```
## Call in from remote
REST interface means a POST service using the same addressing logic as was implemented in harcon.

@@ -94,2 +119,5 @@ An division-aware URI composed by name or context and a service function's name

- 1.0.0 : moving to harcon v2
- 0.8.0 : addressing via names added
- 0.5.0 : refactoring and moving to harcon v1
- 0.1.0 : initial release
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