![Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility](https://cdn.sanity.io/images/cgdhsj6q/production/97774ea8c88cc8f4bed2766c31994ebc38116948-1664x1366.png?w=400&fit=max&auto=format)
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
var api = new APISDK([
// An API definition list here
'POST /articles',
'GET /articles/:id',
'PUT /articles/:id',
'DELETE /articles/:id'
], {
'host': '/api',
// 'promise' and 'http' MUST be provided
'promise': Promise,
'http': function(params) { console.log(params); }
});
var id = 123;
// { "method": "get", "url": "/api/articles/123", "data": { "token": 789 } }
api.articles(id).get({ token: 789 });
// Dynamic parameter is supported
var inc = 0;
var nextArticle = api.articles(function() { return inc++; });
// { method: "GET", url: "/api/articles/0", data: undefined }
nextArticle.get();
// { method: "GET", url: "/api/articles/1", data: undefined }
nextArticle.get();
// Asynchronous parameter is supportd
var asyncParam = new Promise(function(resolve){ setTimeout(resolve, 1000, 123); });
// The request will be launched after the promise resolved
api.articles(asyncParam).get();
/**
* GET /users/:user_id/
* GET /users/:user_id/orders
* POST /users/:user_id/orders
* GET /users/:user_id/orders/:order_id
* POST /users/:user_id/orders/:order_id/payment
* POST /users/:user_id/orders/:order_id/rating
* POST /users/:user_id/orders/:order_id/cancel
* POST /users/:user_id/orders/:order_id/refunding
**/
var currentUserId = 123;
// Create a 'user' object for current user
var user = api.users(currentUserId);
// Get current user profile
user.get();
// Create an 'order' object
var order = user.orders(123);
// Get order information
order.get();
// Post a payment request for this order
order.payment.post();
// Post a rating for this order
order.rating.post();
// Post a order canceling request for this order
order.cancel.post();
// Post refunding request for this order
order.refunding.post();
bower install apisdk
<script src="/bower_components/apisdk/apisdk.js"></script>
FAQs
APISDK with ES6Module
The npm package apisdk receives a total of 4 weekly downloads. As such, apisdk popularity was classified as not popular.
We found that apisdk 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.