
Security News
PEP 810 Proposes Explicit Lazy Imports for Python 3.15
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
Pronto is a Node.js library for building very fast applications. Create a request, assign it a list of commands to execute, and then run it.
Pronto is a great fit for:
Pronto.js is a simple tool for executing a sequence of tasks. It looks declarative -- you create a list -- but in the background, Pronto takes full advantage of Node's event model. The result is that you can easily write very fast code.
Pronto encourages you to do the following:
And while you focus on building small parts and chaining them together, Pronto handles the "eventing", feeding the application to Node as a fully evented sequence. This allows Node to execute your application at full speed -- even under load.
You can take a look at a sample Pronto project here: https://github.com/technosophos/pronto-example
There are only two things you need to know how to do:
Pronto works by taking a request from the client and responding by executing a list of tasks. Building a Pronto application is basically a process of assembling chains of commands.
Pronto provides a fluent interface for declaring your task list. Here is a simple example:
var register = new pronto.Registry();
register.route('hello')
.doesCommand(HelloCommand, 'print-hello');
The above registers a single request (hello
). Executing the hello
request will execute the task HelloCommand
, named print-hello
.
More often than not, a request executes multiple commands in a row, systematically assembling data and returning it only at the end. For example, a simple search engine request might look like this:
register.route('search')
.does(InitializeSearchService, 'initialization')
.does(QueryRemoteSearchService, 'do-search')
.uses('query').from('get:q')
.does(SearchTheme, 'format-search-results')
.uses('searchResults').from('cxt:do-search')
;
The example above declares a request with three commands: initialization
, do-search
, and format-search-results
. In this hypothetical request, we have broken down the task of searching into three steps.
from('get:q')
indicates that the query parameter is retrieved from the query
GET variable.do-search
(again: from('cxt:do-search')
), pass that through a theming system.While the above is fictional, it illustrates how a chain of commands is assembled.
Along with creating a chain of commands, you may also need to write some custom commands. Commands are small single-purpose units of code.
Creating a command is as simple as extending the base task prototype, implementing just a method or two. Here is an example command that, when executed, prints Hello World
. There are three things to note about the example below:
Command
prototype.execute()
method.When Pronto encounters this command in a chain, it will run the the command's execute()
method.
// Constructor
function HelloCommand() {}
// Inherit prototype
util.inherits(HelloCommand, pronto.Command);
// Override the execute() method.
HelloCommand.prototype.execute = function(context, params) {
console.log('Hello World');
this.done();
}
The above simply prints Hello World
to the console.
While we're pre-1.0, the Pronto project is fairly stable, now, and has NPM packages.
This project was sponsored by ConsumerSearch.com, part of the About.Com network, a New York Times company.
Pronto.js is made available under an MIT-style license.
FAQs
Application building framework
We found that pronto 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
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.