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

cjs-rename

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cjs-rename

Rename a CJS file thing

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-71.43%
Maintainers
1
Weekly downloads
 
Created
Source

cjs-rename

Inspired by https://github.com/timruffles/misnomer/blob/master/README.md.

CLI Usage

// current usage
cjs-rename -t ../source/old.js -f ../source/new.js -s ../source

// timruffles idea - only specify file names, not paths
cjs-rename old.js new.js ../source

// my idea - if no source is specified, use current dir
cjs-rename old.js new.js

Module Usage

var Rename = require('cjs-rename');

var rename = new Rename({
    cwd: '...', // optional
    to: '...',
    from: '...',
    folder: '...'
});

rename.run(function (err, changes) {
    if (err) {
        console.log(err);
    } else {
        console.log(changes);
    }
});

Todo

  • Only add the '.js' extension if it was there before
  • Write tests
  • Improve command line interface
  • Add MIT license
  • Move files

Changelog

0.0.2

  • Add github page to package.json

0.0.1

  • Initial commit

License

MIT

Keywords

FAQs

Package last updated on 08 Mar 2014

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

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