npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

glimt

v1.1.0

Published

Comment transpiler written in Node

Downloads

8

Readme

<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

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!