Socket
Book a DemoInstallSign in
Socket

glimt

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

glimt

Comment transpiler written in Node

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

<img src="https://s12.postimg.org/kfxwuls8d/glimt_copy.png" align="center" height="250" "/>

######Glimt is a utility library written in Node. In large applications, you have large modules, often with the same comments around the same thing. Glimt is made, so you can avoid to rewrite those. ######The library has also included some other features, like module clearing and line clearing with no hazzle

#List of Content

  • Installation

##Installation

Running Glimt, requires you to install it globally. It is not supported to run it as a module yet, if you want to run Glimt locally without installing it global, submit a Feature Request.

To install Glimt, type the following command:

npm install -g glimt

##Setup

Before we can run any scripts, we need to set up one thing, which is a .glimtrc file. In order for Glimt to validate and output at the correct time, we decided it is best for the user to decide where to implement a comment. A .glimtrc is no hazzle. It should look like this once you are done.


{
   "firstComment": [5, "// Look for me at line 5"]
}

Now, what this do, is that it looks at line five if the code at line 5 is the same as what we just wrote. If not, it doesn't compile down to anything. The neat thing about this, is that you can actually swap out entire codelines, not only comments.

For now, having more than 13 characters to replace, may bug your line after the desired replacement line, so keep in mind to either use less than 13 characters until we solve this, or to include a "fallsafe", which would be another comment on the line below in order to preserve your code. Here's an example that will replace your comment with whatever you provide in the CLI

const HelloMessage = (props) => <div>Hello, {props.name}</div>;
HelloMessage.propTypes = {
 name: React.PropTypes.string
}
// Look for me at line 5
HelloMessage.defaultProps = {
 name: 'John Doe'
}
ReactDOM.render(<HelloMessage name="Mădălina"/>, mountNode);

Now you can run CLI-commands!

##Commands

######You might need to prefix your commands with sudo

###Clearing Modules

If you want to clear every file in a folder, run:

glimt -n myFolder

If you want to only clear one File, run:

glimt -f myFolder/myfile.js

If you want to clear the line where your comment from .glimtrc is, run:

glimt -l myFolder/myfile.js

####Converting Comments

If you want to compile an entire directory of files, run:

glimt -d myFolder GlimtIsAwesome

If you want to compile a given file in a directory, run:

glimt -o myFolder/myfile.js GlimtIsAwesome

##Contribution

Contributions are warmly welcomed! I'd like to use this occasion to thank Sindre Sorhus for being helpful to everyone all the time while making open-source great!

Keywords

transpiler

FAQs

Package last updated on 06 Sep 2016

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