
Security News
Socket Releases Free Certified Patches for Critical vm2 Sandbox Escape
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.
Share functions with other js clients. Call backend functions with type-safety.
Share functions with other JS clients. Call backend functions with type-safety.
Actioman is a tool to expose Javascript functions as web services in a simple and fast way. With actioman, you can build robust and type-safe APIs using your existing Javascript functions, facilitating communication between your backend and Javascript clients (whether they are browsers, mobile applications, or even other backend services).

To start using actioman, follow these simple steps:
Create an actions.js file:
Create a file named actions.js in your project. In this file, define the Javascript functions you want to expose as services.
// ./actions.js
export const hello = () => "hello world";
Start the actioman server:
Open your terminal in the root of your project and run the following command to start the actioman server, serving the functions defined in actions.js:
npx actioman actions.js
When you run this command, you will see a message similar to this in the console:
Route GET /__actions
Route POST /__actions/hello
Listening on http://localhost:30320/
This message indicates:
Route GET /__actions: A GET route has been created at /__actions. This route exposes the contracts of all services defined in actions.js in JSON format. You can use it to inspect the structure of your services.Route POST /__actions/hello: A POST route has been created at /__actions/hello. This route corresponds to the hello function you defined in actions.js. To invoke this service, you will need to make a POST request to this URL.Listening on http://localhost:30320/: The actioman server is running and listening for requests at the URL http://localhost:30320/. The port 30320 may vary.Once your actioman service is running, you can consume it from another Javascript project. Follow these steps to import and use your services:
Install the actioman dependency:
In your client project, install the actioman library using npm:
npm add actioman
Add the Actioman service:
Use the actioman add command to register an Actioman service in your client project. Replace myservice with the name you want to give to your service locally, and http://localhost:30320/ with the URL where your actioman server is running (the one shown in the console when you started the server).
npx actioman add myservice http://localhost:30320/
This command configures actioman so that it can access the services exposed at the provided URL under the name myservice.
Use the services in your code:
Now you can import and use your actioman services in your Javascript code. The following example shows how to call the hello function of the myservice service:
// my-app.js
import { actions } from "actioman";
const myservice = actions.myservice();
const message = await myservice.hello();
console.log(message); // => "hello world"
In this code:
import { actions } from "actioman": Imports the actions object from the actioman library.const myservice = actions.myservice(): Creates an instance of the myservice service that you configured previously. actions.myservice() generates a type-safe client to interact with your remote service.await myservice.hello(): Calls the hello function of the myservice service. This call translates into an HTTP request to the actioman server. Since service calls are asynchronous, we use await to wait for the response.FAQs
Share functions with other js clients. Call backend functions with type-safety.
We found that actioman demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.

Research
Five malicious NuGet packages impersonate Chinese .NET libraries to deploy a stealer targeting browser credentials, crypto wallets, SSH keys, and local files.

Security News
pnpm 11 turns on a 1-day Minimum Release Age and blocks exotic subdeps by default, adding safeguards against fast-moving supply chain attacks.