Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Data layer for nodejs apps. Provides a internal url interface to grab data.
Your routes shouldn't need to know where data is coming from. You should be able to swap out data sources in a relatively easy manner and still have your websites templates render the exact same way. You should be able to connect the same data to different output formats with ease.
This module provides a way to access your data through internal routes and provides the ability to cache the data. It also provides a template rendering controller and JSON rendering controller.
Add a handler for the specified url.
addRoute('blog/:slug', function(req, cb) {
getBlogPost(req.params.slug, cb)
})
Helper to easily compile several routes into one object
compositeRoute('blog/:slug/data',
{ 'blog/:slug': 'blogPost'
, 'blog/:slug/comments': 'comments'
})
// Generates
// { blogPost: blogPostData
// , comments: commentData
// }
Get data from specified route.
getData('blog/first-post', function(err, post) {
if (err) return handleErr(err)
doSomethingBlogPost(post)
})
External url handler that will render a template with the data result from an internal url
app.get('/blog/:slug', connectDataTemplate('blog/:slug/data', 'blogPost'))
External url handler that gives JSON output of internal url data
app.get('/api/blog/:slug/comments', connectJSONTemplate('blog/:slug/comments'))
FAQs
Data layer for nodejs apps. Provides a internal url interface to grab data.
The npm package data-layer receives a total of 5 weekly downloads. As such, data-layer popularity was classified as not popular.
We found that data-layer 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
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.