
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
node-sunsetwx
Advanced tools
A wrapper for SunsetWx's Sunburst API, which provides sunset and sunrise quality forecasts.
node-sunsetwx is a Node.js wrapper for SunsetWx's Sunburst API, which provides sunset and sunrise quality forecasts.
Currently, the API is in beta. To get started you need to email team@sunsetwx.com to get a registration key.
You'll want to reference the Sunburst API docs for more detailed info on parameters and responses.
$ npm install node-sunsetwx
Before you interact with the API, you need to register your email address and password using the registration key you received. This is a one-time task. An email confirmation will be sent, which you need to acknowledge before you'll be able to log in.
Since you'll only be doing this once, you might as well do it in the interactive Node.js REPL:
$ node
Load the library:
var SunsetWx = require('node-sunsetwx');
Create the API object, including your email, a password (longer than six characters, at least one uppercase, one lowercase, and one number), and your registration key:
var sunsetwx = new SunsetWx({
email: 'you@example.com',
password: '12345Ab',
key: 'fOd2dUpB3L5oq42CKOq7NPsX'
});
Call the .register method, with a callback to print the response:
sunsetwx.register(function(err, response, body){
console.log(body);
});
You should see this:
{
"message": "Verification email sent"
}
Click the link in the verification email before continuing.
Note: all callbacks are passed directly to the requests library, which handles the actual https request. Thus, callbacks will receive the following as described by requests:
error, if applicablehttp.IncomingMessage objectresponse body, as a JSON objectFor much more detail on API parameters and responses, please read the Sunburst API Docs.
Creates a new API object with (minimally) your email and password. Automatically handles login, authentication, and auth token refresh.
var sunsetwx = new SunsetWx({
email: 'you@example.com',
password: '12345Ab'
});
email: (required) the email you signed up withpassword: (required) the password you chose when registeringkey: (optional) your registration key, only required for registrationbase_url: (optional) an alternate base URL for the API. (default: https://sunburst.sunsetwx.com/v1/)Registers the email and password using the key provided to the constructor.
sunsetwx.register(callback)
Logs in using the email and password provided to the constructor, storing the auth token for use during subsequent API calls. This is handled automatically, so you should actually never have to call .login() manually.
sunsetwx.login(callback)
Logs out the current auth token and destroys it.
sunsetwx.logout(callback)
Triggers a password reset request. You will receive an email with a link to complete the process.
sunsetwx.passwordReset(callback)
Deletes the current account. Note: this cannot be undone.
sunsetwx.deleteAccount(callback)
Returns longitude and latitude coordinates for the given location string.
sunsetwx.coordinates({
location: 'Rochester, NY'
}, callback)
location: (required) a string that contains a location nameReturns a location name for the coordinates in coords
sunsetwx.location({
coords: '-77.331536,43.271152'
}, callback)
coords: (required) a string that contains valid longitude and latitude, separated by only a comma.sunsetwx.quality({
coords: '-77.331536,43.271152',
type: 'sunset',
location: 'northamerica',
radius: '24.02',
limit: '42',
timestamp: '2016-07-07T16:26:08Z'
}, callback)
coords: (required) a string that contains valid longitude and latitude, separated by only a comma.type: (required) a string to indicate 'sunrise' or 'sunset'location: (optional) a string containing a valid model location of 'global' or 'northamerica'radius: (optional) a number that limits the returned points to the indicated radius in kilometers.limit: (optional) an integer that limits the number of returned pointstimestamp: (optional) a valid RFC3339 timestamp within the next three days, for prediction of future sunrises and sunsets.Sure.
This software is licensed under the MIT License. See the LICENSE file for details.
FAQs
A wrapper for SunsetWx's Sunburst API, which provides sunset and sunrise quality forecasts.
We found that node-sunsetwx 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.