![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
cms_applog_models
Advanced tools
#This Beta Test Please Skip
Now sendIgnoreResponse
function and Middleware
function use UDP Protocal
npm i cms_applog_models
applog.js
const { ApplogModel } = require('cms_applog_models');
let requestOptions = {
uri: 'localhost',
uri_udp: 'localhost:2222'
headers: {
Authorization: 'api_token'
},
timeout: 5000,
json: true,
method: 'POST'
}
let ApplogConfig = {
self_system: 'test',
self_group: 'test',
self_type: 'test'
}
let mode = 'normal'
exports.Log = class extends ApplogModel{
constructor(){
super(requestOptions,ApplogConfig,mode);
}
}
test.js
const { Log } = require('./applog');
let applog = new Log();
applog.setMessage('Test')
.setRequest({ code: 200, message: 'success' })
.setEnvironment('local')
.setSelfFunction('test')
.send(3);
applog.js
const { createMiddleware } = require('cms_applog_models');
let requestOptions = {
uri: 'localhost',
uri_udp: 'localhost:3232'
headers: {
Authorization: 'api_token'
},
timeout: 5000,
json: true,
method: 'POST'
}
let ApplogConfig = {
self_system: 'test',
self_group: 'test',
self_type: 'test'
}
let mode = 'loadtest'
exports.logMiddleware = createMiddleware(requestOptions,ApplogConfig,mode);
index.js
const express = require('express');
const app = express();
const { logMiddleware } = require('./applog');
app.get('/test',logMiddleware,(req,res)=>{
setTimeout(() => {
res.send({code:200}).saveLog('Hello')
}, 3000);
});
app.listen(3000,()=>{
console.log('Listen on port: ' + 3000);
});
see Request Options
uri_udp
: udp link <http[s]://hostname:port
> ex. http://localhost:2222
self_system
: system nameself_group
: group of systemself_type
: type of systemnormal
: defaultloadtest
: not send log in this modeFAQs
cms applog v2 model
The npm package cms_applog_models receives a total of 32 weekly downloads. As such, cms_applog_models popularity was classified as not popular.
We found that cms_applog_models 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
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.