npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

zerosap

v1.0.1

Published

Access SAP-RFC via ZeroRPC-proxy installed on pyRFC virtual environment.

Downloads

17

Readme

zerosap

Library to call SAP pyRFC from NodeJs

Dispatcher API

Using this module, NodeJS can dispatch RFC calls to a SAP backend system.

More API Documentation coming soon. Meanwhile, look at app.js .

Worker

Zerosap uses the official SAP pyRFC python library, and wraps it as the "Zerosap Worker".
As a first-class library fully supported by SAP, pyRFC ensures that Zerosap has great stability and full capabilities (e.g. RFC server scenario).

We support two ways of running this worker:

A. Embedded into NodeJs

  • NodeJs automatically manages the Python worker process via a zerorpc bridge.
  • This scenario is great for getting started.

B. Remote Daemon

  • A "Zerosap Worker" runs as a daemon on a Python-capable host within the internal network/LAN.

  • The host can be the UNIX/Windows server that also hosts SAP Netweaver itself (or another host that have access to the RFC Ports of the target SAP system).

  • The Worker connects back to the NodeJS Dispatcher to receive instructions via a secure zerorpc channel.

  • Multiple Worker instances enable NodeJS to act as a reverse proxy and load balancer, as RFC requests are fanned out from NodeJS to multiple target SAP backend systems.

  • Elliptic-curve cryptography is used.

  • This scenario is great where security and performance is paramount.

Dependencies

  • libzmq.so >= 4.0.5 (with libsodium support)
  • zerorpc >= 0.4.4
  • pyrfc >= 1.9.4
  • daemonize >= 2.3.1

Installation

ZeroRPC Installation

Libsodium
	wget https://github.com/jedisct1/libsodium/releases/download/1.0.1/libsodium-1.0.1.tar.gz
	dig +dnssec +short txt libsodium-1.0.1.tar.gz.download.libsodium.org
	cat libsodium-1.0.1.tar.gz | openssl dgst -sha256  # If the output is not the same as from the previous command, abort as the downloaded file has been tampered with.
	tar -xvf libsodium-1.0.1.tar.gz
	cd libsodium-1.0.1
	./configure
	make && make check  # Ensure all tests pass.
	sudo make install
	ls /usr/local/lib/
ZeroMQ
	wget http://download.zeromq.org/zeromq-4.0.5.tar.gz
	tar -xvf zeromq-4.0.5.tar.gz
	cd zeromq-4.0.5
	sudo yum install gcc-c++
	./configure
	make && make check  # Ensure all tests pass.
	sudo make install
	ls /usr/local/lib/
ZeroRPC for Python
  • ZeroRPC cannot be installed directly via pip / easy_install due to pyzmq that is pinned to an outdated version (version 14.1.1 & above has solved the issue).
  • These instructions will install directly from their GitHub master (for libsodium cryptographic support):
	wget https://github.com/dotcloud/zerorpc-python/archive/master.zip
	unzip master.zip
	cd zerorpc-python-master/
	nano setup.py   # Change to pyzmq>=14.1.1
	PKG_CONFIG_PATH=/usr/local/lib/pkgconfig python setup.py install

pyRFC Installation

  • Installing pyrfc requires the SAP NW RFC SDK that is distributed on the SAP Support Portal.
  • Further instructions here.
  • Downloads
	wget https://raw.githubusercontent.com/SAP/PyRFC/master/dist/pyrfc-1.9.4-py2.7-linux-x86_64.egg
	easy_install pyrfc-1.9.4-py2.7-linux-x86_64.egg

Daemonize Instalation

  • The easiest to install.
	pip install daemonize

Configuration

The zerosap worker reads environmental variables for configuration:

start.sh

	#!/bin/bash
	DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
	cd "${DIR}"

	# source /opt/rh/python27/enable
	PARAMS=$@ scl enable python27 - << \EOF

	source bin/activate

	export USER=zerosap
	export GROUP=zerosap 
	export ZEROSAP_ZMQ_HUB=tcp://<ipaddress of nodejs zerosap-dispatcher>:4801

	cd zerosap/
	ZEROSAP_RFC_CLIENT=100 ZEROSAP_RFC_USER=<username> ZEROSAP_RFC_PASSWD=<password> python bin/zerosap.py ${PARAMS}

	EOF

Startup

  • Starting the zerosap worker daemon is simple:
	sudo useradd -r zerosap
	sudo usermod -a -G zerosap prdadm
	
	chmod +x /usr/sap/PythonVE/py27-pyrfc/start.sh
	sudo /usr/sap/PythonVE/py27-pyrfc/start.sh
	tail -f /tmp/zerosap.log