Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

detect-rename

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

detect-rename

Detect file renames based on the file contents

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

Introduction

The goal of this package is, to detect file renames based on the file contents, similar to the way git does it. Files and contents are provided as javascript object, so this module should not need to access file system and may even work in a browser.

Example

var detect = require("detect-rename.js");

console.log(detect({
   "abc": "Lorem ipsum sit desc",
   "cde": "Lorem ipsum sit incro",
   "qwertz": "poiu",
   "cdeg": "Lorem ipsum sit incroa"
},{
   "abcd": "Lorem ipsum sit desca",
   "cdef": "Lorem ipsum sit incro",
   "qwertz": "poiu"
}));

Output:

{
cdef: { from: 'cde', sim: 1 },
abcd: { from: 'abc', sim: 0.9629629629629629 }
}

See the jsdoc comment for options

Changes

####0.0.1

  • Initial checkin

####0.1.0

  • Changed the output to use the target file as object key. This is more useful, because this is what the target file is like in the currently.

Please note that this api is still experimental until version 1.0. Feedback is welcome, although I cannot guarantee any response times at the moment.

FAQs

Package last updated on 29 Jan 2015

Did you know?

Socket

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.

Install

Related posts