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

flexus-net

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flexus-net

wrapper for node net module

  • 1.0.9
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

flexus-net

What and why?

This is (for now) just a simple wrapper module that makes lifes easier when installing Node.js net module with JSPM for usage in browser-like app enviroments. Namely in Chrome packages apps and Windows modern apps. Chrome provides quirky and overly complex chrome.sockets.tcp API for TCP socket communication which is wrapped by wonderful module chrome-net to provide the same API as Node.js net. And flexus-net basically just wraps chrome-net with intention to implement similar wrapper for Windows API in the future.

installation

jspm install npm:flexus-net

tips & tricks

You can rename the module from flexus-net to net in your JSPM config file and then use it simply as

import net from 'net';

or

var net = require('net');

Sweet. Now how to do it? In JSPM config file there is property map with names and mappings of all modules. This is an example of JSPM 0.17 jspm.config.js

map: {
  "flexus-net": "npm:flexus-net@1.0.8",
  "events": "github:jspm/nodelibs-events@0.2.0-alpha",
  "process": "github:jspm/nodelibs-process@0.2.0-alpha",
  ...

where you change the name like so

map: {
  "net": "npm:flexus-net@1.0.8",
  ...

Now you can write your app with net module like you would in Node and JSPM handles picking the right module for given enviroment. When runnig in Chrome App the chrome-net is used in background or when run in Node using JSPM run path_to_your.js the native module is used.

thanks to

Feross Aboukhadijeh, John Hiesey & Jan Schä for creating chrome-net and Guy Bedford for JSPM

Keywords

FAQs

Package last updated on 01 Mar 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