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

file-template

v0.0.2

Published

When you are going to quickly create a file for testing or practicing a programming language, you might need to create it and write down some code manually. Some codes of most of your same language programs may appear again and again and again...., blabla

Downloads

8

Readme

#File Template When you are going to quickly create a file for testing or practicing a programming language, you might need to create it and write down some code manually. Some codes of most of your same language programs may appear again and again and again...., blablabla.

For example, if you're just a newbie studying C programming language. The most codes in your practice files might contains such like this:

#include<stdio.h>
#include<stdlib.h>

int main(int argc, char* argv[])
{
	printf("Hello World!");
	return 0;
}

Haha, this is not a hello world generator. Alright, printf("");, instead, is the most used. Anyway, if you need to retype this snippet every time, it implies that it should be automatically generated. That's what this program does. It deal with most common part of each language.

#Install npm insall -g file-template

#Usage ftemplate <filename>.<extension> [options]

Current support programming languages:

  • HTML
  • Java
  • C
  • C++
  • C#

###Options:

  • --help
  • create without
    • --no-script: create without <script> tag
    • --no-link: create without <link> tag
  • with standard
    • -html4: use html doctype before HTML5

##example

  • Create an HTML: ftemplate index.html

    <!DOCTYPE>
    <html>
    	<head>
    		<tilte></title>
    		<script ></script> <!-- JavaScript Loader -->
    		<link> <!-- CSS loader-->
    	</head>
    	<body>		
    	</body>
    </html>
  • Create a Java file: ftemplate hello.java

    import java.lang.*;
      
    class hello{
    	public static void main(String[] args){
      	
    		System.out.println("");
      		
    		return 0;
    	}
    }
  • Create an HTML with no <script type="text/javascript" src=""></script> tag:

    ftemplate index.html --no-script

#Test We use two test drivers with Sinon and Mocha libraries to launch test, they should be installed as a global command in your computer in advanced:

  1. Mocha (recommend)

    1. cd test
    2. mocha *_test.js
  2. Karma with Mocha:

    You can stay in the root directory and just use folllowing commands to skin a cat. We primitively created two karma.conf.js for Karma, so you should have installed public version of Chrome or Firefox OS.

    1. karma start chrome.conf.js
    2. karma start firefox.conf.js

#Changelog

2015/02/14 Add C# context. (by larrywhy)

#Contribution We are very welcome any feedback or new template provided. Please contact me with [email protected]. Or you can just clone this repository. Thanks for your courtesy. Hope you like this.