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

osc-min

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

osc-min - npm Package Compare versions

Comparing version 0.0.8 to 0.0.9

.travis.yml

1

lib/index.js
(function() {
//~readme.out~
//[![build status](https://secure.travis-ci.org/russellmcc/node-osc-min.png)](http://travis-ci.org/russellmcc/node-osc-min)
//# osc-min

@@ -5,0 +6,0 @@ //

2

package.json
{
"name": "osc-min",
"version": "0.0.8",
"version": "0.0.9",
"main": "lib/index",

@@ -5,0 +5,0 @@ "author": {

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

[![build status](https://secure.travis-ci.org/russellmcc/node-osc-min.png)](http://travis-ci.org/russellmcc/node-osc-min)
# osc-min

@@ -41,44 +42,56 @@

## Examples
### A simple OSC printer
```coffee-script
sock = udp.createSocket "udp4", (msg, rinfo) ->
try
console.log osc.fromBuffer msg
catch error
console.log "invalid OSC packet"
sock.bind inport
### A simple OSC printer;
```javascript
sock = udp.createSocket("udp4", function(msg, rinfo) {
try {
return console.log(osc.fromBuffer(msg));
} catch (error) {
return console.log("invalid OSC packet");
}
});
sock.bind(inport);
```
### Send a bunch of args every two seconds
```coffee-script
sendHeartbeat = () ->
buf = osc.toBuffer(
address : "/heartbeat"
args : [
12
"sttttring"
new Buffer "beat"
{type : "integer", value : 7}
]
)
### Send a bunch of args every two seconds;
```javascript
udp.send buf, 0, buf.length, outport, "localhost"
setInterval sendHeartbeat, 2000
sendHeartbeat = function() {
var buf;
buf = osc.toBuffer({
address: "/heartbeat",
args: [
12, "sttttring", new Buffer("beat"), {
type: "integer",
value: 7
}
]
});
return udp.send(buf, 0, buf.length, outport, "localhost");
};
setInterval(sendHeartbeat, 2000);
```
### A simple OSC redirecter
```coffee-script
sock = udp.createSocket "udp4", (msg, rinfo) ->
try
redirected = osc.applyAddressTransform msg, (address) -> "/redirect" + address
sock.send(
redirected,
0,
redirected.length,
outport,
"localhost"
)
catch error
console.log "error redirecting: " + error
sock.bind inport
### A simple OSC redirecter;
```javascript
sock = udp.createSocket("udp4", function(msg, rinfo) {
var redirected;
try {
redirected = osc.applyAddressTransform(msg, function(address) {
return "/redirect" + address;
});
return sock.send(redirected, 0, redirected.length, outport, "localhost");
} catch (error) {
return console.log("error redirecting: " + error);
}
});
sock.bind(inport);
```

@@ -85,0 +98,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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