Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
node-mdaemon-api
Advanced tools
Readme
node-mdaemon-api
strives to be an easily embeddable bridge to
MDaemon's functionality.
MDaemon's native APIs have been reviewed and adapted to behave as much as possible as ECMAScript/TypeScript functions.
node-mdaemon-api
developer and users meet in the room
Development for MDaemon Email Server.
The developer of node-mdaemon-api
is also in the
MDaemon API Forum.
Due to the nature of the MDaemon SDK, which is per-version with breaking changes possibly happening whenever the first figure (major) and/or the second figure (minor) in the version number change, this package follows strictly the Major.minor version numbering of MDaemon.
For this reason, a module property versionsMatch
is available. It
holds true
if module's major and minor version numbers match
MDaemon's. Please, early abort a script based on node-mdaemon-api
,
if versionsMatch
does not hold.
This package is intended for
If not already present, this package requires the latest VC++ runtime for X64 (permalink) to be installed.
Please, note that
node-mdaemon-api
is a pre-built binary module for Node.js for Microsoft Windows.
All best-practices in security have been followed to ensure the very binary is safe and without any malware. This, however, does not entitle the end user to trust us blindly. We strongly suggest implementing best security practices for the target machine as well and verifying again this package locally. Caveat lector!
Implementation status moved to wiki.
test-md-node
C:\> mkdir test-md-node
C:\> _
C:\> cd test-md-node
C:\test-md-node> _
node --version
and check it correctly reports Node's version
C:\test-md-node>node --version
v20.12.1
C:\test-md-node>
npm init -y
C:\test-md-node>npm init -y
Wrote to C:\test-md-node\package.json:
{
"name": "test-md-node",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
C:\test-md-node>
npm install node-mdaemon-api
C:\test-md-node>npm install node-mdaemon-api
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN node-mdaemon-api@23.5.3-alpha.29 requires a peer of mdaemon@22.x but none is installed. You must install peer dependencies yourself.
npm WARN test-md-node@1.0.0 No description
npm WARN test-md-node@1.0.0 No repository field.
+ node-mdaemon-api@23.5.3-alpha.29
added 1 package from 1 contributor and audited 1 package in 2.278s
found 0 vulnerabilities
C:\test-md-node>
node-mdaemon-api
in your index.js
as const md = require('node-mdaemon-api');
const md = require('node-mdaemon-api');
// use "md" to access MDaemon's APIs...
md
object.WARNING Early abort the script if
versionsMatch
is false.
const md = require('node-mdaemon-api');
if (!md.versionsMatch) {
// Early abort!
throw new Error('MDaemon version and node-mdaemon-api version do NOT match!');
}
// Safe to use "md" to access MDaemon's APIs...
// ...
Minimum ECMASCript example:
'use strict';
const md = require('node-mdaemon-api');
if (!md.versionsMatch) {
// Early abort!
throw new Error('MDaemon version and node-mdaemon-api version do NOT match!');
}
if (md.isReady) {
const mdInfo = md.getMdInfo();
console.log(`MDaemon ${mdInfo.version.full} ready!`);
} else {
console.error('MDaemon not available.');
}
If you set your package.json
's type
to module
, Node.js can use ESM
modules, but import
can not import native
modules
as node-mdaemon-api
. You will need to explicitly create the require
function to load node-mdaemon-api
.
'use strict';
import { createRequire } from 'module';
const require = createRequire(import.meta.url);
const md = require('node-mdaemon-api');
if (!md.versionsMatch) {
// Early abort!
throw new Error('MDaemon version and node-mdaemon-api version do NOT match!');
}
if (md.isReady) {
const mdInfo = md.getMdInfo();
console.log(`MDaemon ${mdInfo.version.full} ready!`);
} else {
console.error('MDaemon not available.');
}
Minimum TypeScript example:
import { isReady, versionsMatch, MD_GetDomainNames } from "node-mdaemon-api";
function getDomains(pattern?: RegExp): string[] {
const domains: string[] = MD_GetDomainNames() ?? [];
return pattern ? domains.filter(d => pattern.test(d)) : domains;
}
if (!versionsMatch) {
// Early abort!
throw new Error('MDaemon version and node-mdaemon-api version do NOT match!');
}
if (isReady) {
getDomains().forEach(domainName => console.log(`- ${domainName}`));
} else {
console.error('MDaemon not available.');
}
I would like to thank the MDaemon Technologies, Ltd. developers because, despite their busy schedules, they always find time to answer my questions on the more intricate aspects of native APIs.
MDaemon® is a trademark of MDaemon Technologies, Ltd. MDaemon Technologies makes no representations, endorsements, or warranties regarding Third Party Products or Services.
Node.js is a trademark of OpenJS Foundation.
Windows™ is a trademark of Microsoft Corp.
node-mdaemon-api 23.5.3-alpha.29 license
Copyright (c) 2016-2024 Emanuele Aliberti, MTKA
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Unofficial Node.js binding for MDaemon APIs
The npm package node-mdaemon-api receives a total of 1 weekly downloads. As such, node-mdaemon-api popularity was classified as not popular.
We found that node-mdaemon-api demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.