
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
netstorageapi
Advanced tools
NetstorageAPI is Akamai Netstorage (File/Object Store) API for Node.js 4.0+ with native http module.
To install Netstorage API for Node.js:
$ npm install --save netstorageapi
> const Netstorage = require('netstorageapi')
>
> const config = { hostname: 'astinobj-nsu.akamaihd.net', keyName: 'astinobj', key: 'xxxxxxxxxx', cpCode: '407617', ssl: false }
> // Don't expose KEY on your public repository.
> // Default SSL value is FALSE
> var ns = new Netstorage(config)
> var local_source = 'hello.txt'
> var netstorage_destination = `/${config.cpCode}/hello.txt` // or `/${config.cpCode}/` is same.
>
> ns.upload(local_source, netstorage_destination, (error, response, body) => {
... if (error) { // errors other than http response codes
... console.log(`Got error: ${error.message}`)
... }
... if (response.statusCode == 200) {
... console.log(body)
... }
... });
{ message: 'Request Processed.' }
>
> function callback(error, response, body) { /* do something */ }
>
> ns.delete(NETSTORAGE_PATH, callback);
> ns.dir(NETSTORAGE_PATH, callback);
> ns.list(NETSTORAGE_PATH, ACTIONS_OBJ, callback);
> ns.download(NETSTORAGE_SOURCE, LOCAL_DESTINATION, callback);
> ns.du(NETSTORAGE_PATH, callback);
> ns.mkdir(`#{NETSTORAGE_PATH}/#{DIRECTORY_NAME}`, callback);
> ns.mtime(NETSTORAGE_PATH, Math.floor(Date.now()/1000), callback);
> ns.quick_delete(NETSTORAGE_DIR, callback); // needs to be enabled on the CP Code
> ns.rename(NETSTORAGE_TARGET, NETSTORAGE_DESTINATION, callback);
> ns.rmdir(NETSTORAGE_DIR, callback); // remove empty direcoty
> ns.stat(NETSTORAGE_PATH, callback);
> ns.symlink(NETSTORAGE_TARGET, NETSTORAGE_DESTINATION, callback);
> ns.upload(LOCAL_SOURCE, NETSTORAGE_DESTINATION, callback);
>
> // INFO: can "upload" Only a single file, not directory.
> // WARN: can raise FILE related error in "download" and "upload",
> // see error object in callback.
You can test all above methods with Unit Test Script. you should configure api-config.json. It uses Mocha for the test:
$ npm install --global mocha
...
$ export TEST_MODE=LOCAL # use test/api-config.json
$ mocha --no-timeouts test/test_netstorage.js
### Netstorage test ###
ns.dir("/407617", callback);
✓ should return 200 OK
ns.list("/407617", { "max_entries": 5 }, callback);
✓ should return 200 OK
ns.mkdir("/407617/nst_1485516660306", callback);
✓ should return 200 OK
ns.upload("/Users/achoi/Projects/NetStorageKit-Node/test/nst_1485516660306.txt", "/407617/nst_1485516660306/nst_1485516660306.txt", callback);
✓ should return 200 OK
ns.du("/407617/nst_1485516660306", callback);
✓ should return 200 OK
ns.mtime("/407617/nst_1485516660306/nst_1485516660306.txt", 1485516660, callback);
✓ should return 200 OK
ns.stat("/407617/nst_1485516660306/nst_1485516660306.txt", callback);
✓ should return 200 OK
ns.symlink("/407617/nst_1485516660306/nst_1485516660306.txt", "/407617/nst_1485516660306/nst_1485516660306.txt_lnk", callback);
✓ should return 200 OK
ns.rename("/407617/nst_1485516660306/nst_1485516660306.txt", "/407617/nst_1485516660306/nst_1485516660306.txt_rename", callback);
✓ should return 200 OK
ns.download("/407617/nst_1485516660306/nst_1485516660306.txt_rename", callback);
✓ should return 200 OK
ns.delete("/407617/nst_1485516660306/nst_1485516660306.txt_rename", callback);
✓ should return 200 OK
ns.delete("/407617/nst_1485516660306/nst_1485516660306.txt_lnk", callback);
✓ should return 200 OK
ns.rmdir("/407617/nst_1485516660306", callback);
✓ should return 200 OK
### Error test ###
ns.dir('invalid ns path', callback);
✓ should get Error object
ns.list('invalid ns path', { "max_entries": 5 }, callback);
✓ should get Error object
ns.list("/407617", { badObj: true }, callback);
✓ should get Error object
ns.upload("invalid local path", "/407617/nst_1485516660306/nst_1485516660306.txt" callback);
✓ should get Error object
ns.download("/123456/directory/", "/Users/achoi/Projects/NetStorageKit-Node/test/nst_1485516660306.txt" callback);
✓ should get Error object
18 passing (..s)
Astin Choi (achoi@akamai.com)
Copyright 2016 Akamai Technologies, Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
FAQs
Akamai Netstorage API for Node.js
The npm package netstorageapi receives a total of 4,548 weekly downloads. As such, netstorageapi popularity was classified as popular.
We found that netstorageapi 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.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.