Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Ferp is the easiest, functional-reactive, zero dependency javascript app framework for nodejs and modern browsers.
Like any great idea, it's based on other (much smarter) people's work, namely:
npm install --save ferp
Or grab it from unpkg
<script src="https://unpkg.com/ferp"></script>
<script>
const { ferp } = window;
</script>
// es6
import { app, effects } from 'ferp';
// unpkg
import { app, effects } from 'https://unpkg.com/ferp?module=1';
// from a script tag
// <script src="https://unpkg.com/ferp"></script>
const { app, effects } = window.ferp;
// es5/node
const { app, effects } = require('ferp');
See this handy migration guide!
Here's an app that infinitely adds a counter, and logs it.
const ferp = require('ferp');
const initialState = 0;
const incrementAction = (state) => [state + 1, ferp.effects.act(incrementAction)];
ferp.app({
init: [initialState, ferp.effects.act(incrementAction)],
});
Every app needs an init
tuple, with the initial state, and initial side effect (or ferp.effects.none()
if there isn't one).
There is also a subscribe
method for managing long-term side-effects, like intervals or websocket communication, and observe
to watch for application changes.
You can read more about setting up an application here in the docs.
FAQs
Build functional and pure applications in NodeJS and the Browser!
We found that ferp 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.