🚀 Launch Week Day 4:Introducing the Alert Details Page: A Better Way to Explore Alerts.Learn More →
Socket
Book a DemoInstallSign in
Socket

get-exports

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-exports

CLI for getting/creating a list of node.js export statements for functions in a module. Why? I want to write pure JavaScript and not worry about remembering to add export statements until js-hint complains about it.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

get-exports NPM version

CLI for getting/creating a list of node.js export statements for functions in a module. Why? I want to write pure JavaScript and not worry about remembering to add export statements until js-hint complains about it.

This is more of a linting tool for export statements than anything. Just type ext and the name of the file to read and the CLI will output a list of statements like export.foo = foo'; for you to manually add to the file.

Install

Install with npm:

npm i get-exports --save-dev

Run tests

npm test

Usage

CLI

From the command line, just run:

exp [filename] > foo.txt

In foo.txt you should see something like (of course, with the names of the functions/methods in your application):

exports.foo = foo;
exports.bar = bar;
exports.baz = baz;

I considered adding logic to append this to the file, but this is simple enough and gives you a chance to look things over before adding them to the file.

API

To use with a node.js application, just do:

var getExports = require('get-exports');
getExports('index.js');

Returns something like:

exports.foo = foo;
exports.bar = bar;
exports.baz = baz;

Author

Jon Schlinkert

License

Copyright (c) 2014 Jon Schlinkert, contributors.
Released under the MIT license

This file was generated by verb-cli on September 30, 2014.

FAQs

Package last updated on 30 Sep 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