
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
nfsn-client
Advanced tools
This package implements a Node.js client for the NearlyFreeSpeech.NET API. Additionally, a command-line program that uses the library is provided.
NFSN is a (bretty gud) web host/registrar. Their API allows you to update DNS records and access information about your account, among other things. Note that in order to obtain an API key, you must currently submit a support request. See the API introduction (requires login) for more information.
npm install nfsn-client
Use -g
if you want the CLI to be available globally.
var NfsnClient = require('nfsn-client');
// You'll need your own values for login/apiKey
var client = new NfsnClient({
login: 'joe_user',
apiKey: 'super_secret'
});
client.dns.listRRs('example.com', {type: 'A'}, function(err, resp) {
if (!err) {
console.log(JSON.stringify(resp, undefined, 2));
}
});
In order to access the API, you must construct an instance of NfsnClient
(this is the
root export of this module). NfsnClient
takes a single argument, a dictionary of options,
of which the following are supported:
NTP support is provided because the NFSN API is very time sensitive (you must embed a timestamp in every request). If your system clock deviates by more than 5 seconds from the API servers', you request will be rendered invalid. NTP is optional, and if your system time is configured correctly you can omit these parameters.
client.apiCall(path, method, args, cb)
This is the most flexible entry point to the NFSN client. Specify any resource,
the method to use (GET, PUT, or POST), and a dictionary of arguments to make an
authenticated API call. The cb
should accept the arguments (err, jsonResponse)
.
See the NFSN reference for information about the methods and accessors available, as well as their arguments.
client.dns.listRRs(domain, [opts], cb)
List the DNS resource records associated with the specified domain.
client.dns.addRR(domain, opts, cb)
Add a resource record to a domain's DNS.
client.dns.removeRR(domain, opts, cb)
Remove a resource record from a domain's DNS.
You should be able to call any API method using apiCall
, but if you'd like
to add concrete methods for API functions I'm happy to accept pull requests.
This package also provides an nfsn-client
command-line tool.
usage: nfsn-client --login LOGIN --api-key API_KEY [--use-ntp|-n] [--ntp-host HOST] [--ntp-port PORT] [...] site instance method
A LOGIN
and API_KEY
are required. These can also be specified via the
NFSN_LOGIN
and NFSN_API_KEY
environment variables.
dns
is supported).listRRs
).Note that site and method correspond to a first-level object on client
(e.g. client.dns
)
and a second-level method (e.g. client.dns.listRRs)
respectively.
You may also pass additional arguments specific to the method (e.g. --type
for listRRs
to
restrict results to that record type). These arguments should correspond to the arguments
detailed in the NFSN reference.
Some methods, like addRR
, require parameters. You'll get an error if you omit these.
The output is pretty-printed JSON, unless it detects you're piping to another command.
nfsn-client --login joe_user --api-key super_secret dns example.com listRRs --type A
export NFSN_LOGIN=joe_user
export NFSN_API_KEY=super_secret
nfsn-client dns example.com listRRs
FAQs
Client for the NearlyFreeSpeech.NET API
We found that nfsn-client 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.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.