Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

castor

Package Overview
Dependencies
Maintainers
2
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

castor - npm Package Compare versions

Comparing version 1.3.4 to 1.4.0

17

index.js

@@ -9,2 +9,3 @@ 'use strict';

const md5 = require('nyks/crypto/md5');
const mkdirpSync = require('nyks/fs/mkdirpSync');

@@ -26,2 +27,18 @@

// return if index has been touched (new file)
writeBuffer(file_name, body) {
let file_md5 = md5(body);
let file_path = this.store.getFilePathFromMd5(file_md5);
let exists = this.checkEntry(file_name, file_md5);
if(exists)
return false;
mkdirpSync(path.dirname(file_path));
let tmp = file_path + ".tmp";
fs.writeFileSync(tmp, body);
fs.renameSync(tmp, file_path);
return this._update(file_name, file_md5);
}
get(file_name) {

@@ -28,0 +45,0 @@ if(!file_name)

2

package.json
{
"name": "castor",
"version": "1.3.4",
"version": "1.4.0",
"description": "An ES7 [CAS designed](https://en.wikipedia.org/wiki/Content-addressable_storage) file storage for nodejs with a simple API and robust implementation.",

@@ -5,0 +5,0 @@ "main": "store.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc