Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@nodesecure/contact
Advanced tools
Utilities to extract/fetch data on NPM contacts (author, maintainers ..)
Utilities to extract/fetch data on NPM contacts (author, maintainers etc..)
This package is available in the Node Package Repository and can be easily installed with npm or yarn.
$ npm i @nodesecure/contact
# or
$ yarn add @nodesecure/contact
Here is an example of usage from the Scanner. In this case, we are using dependenciesMap, which is a Record<string, Dependency>
. However, you can build your own record of ContactExtractorPackageMetadata
.
import {
ContactExtractor,
type ContactExtractorPackageMetadata
} from "@nodesecure/contact";
const dependencies: Record<string, ContactExtractorPackageMetadata> = Object.create(null);
for (const [packageName, dependency] of dependenciesMap) {
const { author, maintainers } = dependency.metadata;
dependencies[packageName] = {
maintainers,
...( author === null ? {} : { author } )
}
}
const extractor = new ContactExtractor({
highlight: [
{
name: "Sindre Sorhus"
}
]
});
const contacts = extractor.fromDependencies(
dependencies
);
console.log(contacts);
Contact is defined by the following TypeScript interface:
interface Contact {
email?: string;
url?: string;
name: string;
}
[!NOTE] This package authorizes literal RegExp in the name property
The constructor take a list of contacts you want to find/extract.
interface ContactExtractorOptions {
highlight: Contact[];
}
The method fromDependencies will return an array of IlluminatedContact objects if any are found in the provided dependencies.
type IlluminatedContact = Contact & {
dependencies: string[];
}
Compare two contacts and return true
if they are the same person
import {
compareContact
} from "@nodesecure/contact";
import assert from "node:assert";
assert.ok(
compareContact(
{ name: "john doe" },
{ name: "John Doe" }
)
);
Each string is trimmed, converted to lowercase, and any multiple spaces are reduced to a single space.
interface CompareOptions {
/**
* @default true
*/
compareName?: boolean;
}
MIT
FAQs
Utilities to extract/fetch data on NPM contacts (author, maintainers ..)
We found that @nodesecure/contact demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.