Paul Krill
Editor at Large

New JavaScript library makes prototyping easy

news
Jun 14, 20162 mins

Kakapo.js project helps developers prototype Web apps without the back end

JavaScript is getting mocked, but in a good way.

The JavaScript-based Kakapo.js HTTP mocking library enables developers to replicate back-end logic in a declarative manner in the browser. Thus, apps can be prototyped and developed without the back end, and developers can deactivate Kakapo when moving to production.

Kakapo is currently in beta, although it’s in use in a couple of applications where code coverage is 97 percent, said Hector Zarco, the main developer of Kakapo.

“I basically built Kakapo because I wanted to have a framework that provides all the tools I need to prototype Web apps without having to wait [for] the back end to be ready,” Zarco said. “Also, with Kakapo.js you can build reliable and consistent mocks just in the browser, without having to set up an http server that returns the fake data.”

Kakapo features routing, response, request, and database capabilities, but the key feature, Zarco said, is an ability to build advanced uses cases. “Let’s say you have a blog and you want to comment, and later during the app lifecycle you want to retrieve that comment. You can easily build that with Kakapo, instead of just returning static payloads without any sense all the time.”

Kakapo, which is the name of a bird in New Zealand, uses WeakMap, a collection of key/value pairs in JavaScript, with keys weakly referenced. “We had to use it instead of simple hashes because we wanted to use objects as keys instead of plain values like strings,” said Zarco REST, meanwhile, is used to build back end APIs.

Currently limited to Web development, a version of Kakapo also is being readied for Apple’s Swift language, and Node.js compatibility is in the works as well.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author