
Research
npm Malware Targets Telegram Bot Developers with Persistent SSH Backdoors
Malicious npm packages posing as Telegram bot libraries install SSH backdoors and exfiltrate data from Linux developer machines.
@tpluscode/rdf-ns-builders
Advanced tools
Generated RDF/JS namespace builders for common vocabularies
@tpluscode/rdf-ns-builders
Common RDF vocabularies extracted from @zazuko/vocabularies
and wrapped
as @rdfjs/namespace
builder objects.
Also includes TypeScript declarations of the terms included in the known vocabularies as extracted from the actual RDF source file.
const schema = namespace(prefixes.schema)
every so often@rdfjs/namespace
-generated termnpm i -S @tpluscode/rdf-ns-builders
Simply import a namespace builder by its prefix defined in @zazuko/vocabularies
import { schema } from '@tpluscode/rdf-ns-builders'
import { NamedNode } from '@rdfjs/types'
const schemaPerson: NamedNode = schema.Person
You can also add all vocabularies to an environment. Note that this will load everything immediately, even if unused
import { NamedNode } from '@rdfjs/types'
import Environment from '@rdfjs/environment/Environment.js'
import NsBuildersFactory from '@tpluscode/rdf-ns-builders'
const rdf = new Environment([NsBuildersFactory])
const schemaPerson: NamedNode = rdf.ns.schema.Person
The namespace builders exported from the main module allow arbitrary term but in TypeScript, an error will be shown if they do not exist in the vocabulary. Alternatively, loose builders can be imported which will ignore terms from outside the vocabulary.
import { schema } from '@tpluscode/rdf-ns-builders/loose'
import { NamedNode } from '@rdfjs/types'
// will not show error
const schemaPerson: NamedNode = schema.Persona
Given a package with same exports as @zazuko/vocabularies
, it is possible to generate a set of namespace builders generated from your own vocabularies.
Install required peer dependencies:
npm i -D ts-node ts-morph clownface @zazuko/vocabularies safe-identifier
Run the following command to generate builders package by providing the source package name and output directory.
npm run rdf-ns-builders generate -p @my/vocabularies -o builders
This will create a directory source
, containing typescript modules for all vocabularies, similar to those from src.
To extend the interface of env.ns
you need to add you own factory which will add additional
namespace builders to the environment. TypeScript users will also need to extend the CustomPrefixes
interface.
// ./ns.ts
import { NamespaceBuilder } from '@rdfjs/namespace'
type ExampleTerms = 'foo' | 'bar
declare module '@tpluscode/rdf-ns-builders' {
interface CustomNamespaces {
ex: NamespaceBuilder<ExampleTerms>
}
}
export class ExampleNsFactory {
init(this: Environment<NsBuildersFactory | NamespaceFactory>) {
this.ns = {
...this.ns,
ex: this.namespace<ExampleTerms>('https://example.com/'),
}
}
}
Then, use it to create an extended environment.
// ./env.ts
import { create } from '@zazuko/env'
import { ExampleNsFactory } from './ns.js'
export default create(TalosNsFactory)
FAQs
Generated RDF/JS namespace builders for common vocabularies
The npm package @tpluscode/rdf-ns-builders receives a total of 0 weekly downloads. As such, @tpluscode/rdf-ns-builders popularity was classified as not popular.
We found that @tpluscode/rdf-ns-builders 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.
Research
Malicious npm packages posing as Telegram bot libraries install SSH backdoors and exfiltrate data from Linux developer machines.
Security News
pip, PDM, pip-audit, and the packaging library are already adding support for Python’s new lock file format.
Product
Socket's Go support is now generally available, bringing automatic scanning and deep code analysis to all users with Go projects.