{"id":18470364,"url":"https://github.com/aliencreations/alien-node-api-utils","last_synced_at":"2026-02-03T17:37:58.765Z","repository":{"id":35275143,"uuid":"39535936","full_name":"AlienCreations/alien-node-api-utils","owner":"AlienCreations","description":"Helper functions for API handling on NodeJS","archived":false,"fork":false,"pushed_at":"2023-12-31T15:32:10.000Z","size":115,"stargazers_count":0,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-17T14:42:05.436Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlienCreations.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-07-22T23:54:01.000Z","updated_at":"2023-09-13T15:01:58.000Z","dependencies_parsed_at":"2024-11-06T10:13:47.946Z","dependency_job_id":"6bf20bb6-0dc8-41fc-a1a0-fe7befd2024b","html_url":"https://github.com/AlienCreations/alien-node-api-utils","commit_stats":{"total_commits":15,"total_committers":2,"mean_commits":7.5,"dds":0.06666666666666665,"last_synced_commit":"f712fb6eee4589225ec304d9470153a287b84666"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AlienCreations/alien-node-api-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlienCreations%2Falien-node-api-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlienCreations%2Falien-node-api-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlienCreations%2Falien-node-api-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlienCreations%2Falien-node-api-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlienCreations","download_url":"https://codeload.github.com/AlienCreations/alien-node-api-utils/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlienCreations%2Falien-node-api-utils/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260450998,"owners_count":23011186,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T10:13:44.044Z","updated_at":"2026-02-03T17:37:58.714Z","avatar_url":"https://github.com/AlienCreations.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# alien-node-api-utils\nHelper functions for API handling on NodeJS. The functions are pure and curried with Ramda.\n\n[![Build Status](https://travis-ci.org/AlienCreations/alien-node-api-utils.svg?branch=master)](https://travis-ci.org/AlienCreations/alien-node-api-utils) [![Coverage Status](https://coveralls.io/repos/AlienCreations/alien-node-api-utils/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/AlienCreations/alien-node-api-utils?branch=master) [![npm version](http://img.shields.io/npm/v/alien-node-api-utils.svg)](https://npmjs.org/package/alien-node-api-utils) [![Dependency Status](https://david-dm.org/AlienCreations/alien-node-api-utils.svg)](https://david-dm.org/AlienCreations/alien-node-api-utils)\n\n## Install\n\n```\n$ npm install alien-node-api-utils --save\n```\n\nRun the specs\n\n```\n$ npm test\n```\n\n## Usage\n\n```js\n\n// Example API route such as '/users' which could reasonably leverage a \n// 'user' model which would return a promise or catch with an error object.\n\n// The error object passed in the catch should include a 'statusCode' property\n// that is specific to the respective error. If it does not, the api utils \n// will default to 500.\n\n// Note: Because the util functions are curried, we can keep them pure and by \n// invoking with req and res, as shown below.\n\nvar apiUtils  = require('alien-node-api-utils'),\n    userModel = require('./models/user');\n\nfunction getUsers(req, res, next) {\n  userModel.getUsers().\n    then(apiUtils.jsonResponseSuccess(req, res)).\n    catch(apiUtils.jsonResponseError(req, res, next));\n};\n\nmodule.exports = getUsers;\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliencreations%2Falien-node-api-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faliencreations%2Falien-node-api-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliencreations%2Falien-node-api-utils/lists"}