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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@kirinnee/weave

v0.0.3

Published

Scaffolding CLI to generate web templates

Downloads

8

Readme

Weave

Weave a specific scaffolding package that ease my project starts by scaffolding templates to start working with Visual Studio 2017

Getting Started

  1. Install npm or node on your machine

  2. Install binary using npm

$ npm i @kirinnee/weave -g
  1. Execute command at target folder
$ mkdir my-infra
$ cd my-infra
$ weave 

Follow through the instruction and it will generate the project for you

Templating Rules

Variable Replacement

A json weave object will replace all occurence (including file and folder name) that matches the variable:

weave = {
	name: "kirinnee",
	email: "[email protected]",
	description:{
		short: "short des",
		long: "Very very long and informative description. Please something...",
		readme: "# Get Started!!~ "
	}
}

This will replace any expression, whether in name of folder, of

  • w~~weave.name~~ to kirinnee
  • w~~weave.email~~ to [email protected]
  • w~~weave.description.short~~ to short des
  • w~~weave.description.long~~ to Very very long and informative description. Please something...
  • w~~weave.description.readme~~ to # Get Started!!~

Flag lines injection

Within the json object, flags are true or false value.

With Weave, you can inject small code into lines, either as end of line comments or make it part of the code.

Lines with these injection:

  • line will be removed if injected flag is false
  • line will stay, but injected code will be removed, if flag is true

Consider the Wflag object:

wflags = {
	unitTest:false,
	e2eTest: true
}

and the following piece of code:

public static RunTest(string test){
	unitTest.execute(test); // flag~~wflags.unitTest~~
	e2eTest.execute(test); //flag~~wflags.e2eTest~~
}

will be transpiled to

public static RunTest(string test){

	e2eTest.execute(test); //
}

Flag Blocks

Flags can also be used to choose what choose which block of code is in or not.

The Flags will erase the line it is in regardless, but the block encapsulated within will depend on the state of the flag.

Consider the Wflag Object


wflags = {
	useShould: true,
	useExpect: false,
}

and the following code:

// hey lollol if~~wflag.useExpect~~ random stuff here
import {expect} from 'chai';
//end~~wflag.useExpect~~

//if~~wflag.useShould~~
import {should} from 'chai';
should();
//end~~wflag.useShould~~

describe('test',()=>{
	it('should return true if 1 is equal to 1',()=>{
		//if~~wflag.useShould~~
		(1).should.be.equal(1);
		//end~~wflag.useShould~~
		// if~~wflag.useExpect~~
		expect(1).to.equal(1);
		// end~~wflag.useExpect~~

	});
});

will be converted to

import {should} from 'chai';
should();

describe('test',()=>{
	it('should return true if 1 is equal to 1',()=>{
		(1).should.be.equal(1);
	});
});

Package.json dependency filter

By default, you should have all packages installed, regardless. Within the wflag object, have a package object, and any key that has a flag of false will be removed from the package.json.

Consider the wflag object:

wflag = {
	package:{
		"@types/chai": false,
		"chai": false,
		"@types/mocha": true,
		"mocha": true
	}
}

and the following package.json:

{
  "name": "some-package-name",
  "version": "0.0.1",
  "description": "description",
  "devDependencies": {
    "@babel/core": "^7.1.0",
    "@types/chai": "^4.1.5",
    "@types/mocha": "^5.2.5"
  
  },
  "dependencies": {
	 "chai": "^4.1.2",
    "mocha": "^5.2.0"
  }
}

will be converted to

{
  "name": "some-package-name",
  "version": "0.0.1",
  "description": "description",
  "devDependencies": {
    "@babel/core": "^7.1.0",
    "@types/mocha": "^5.2.5"
  
  },
  "dependencies": {
    "mocha": "^5.2.0"
  }
}

Do note that this does not affect peer dependency, and will only apply to package.json file name.

Order of replacement

  1. Block Flags
  2. Line Injection Flags
  3. Variable Replacement
  4. package.json

Community

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

  • kirinnee

License

This project is licensed under the MIT - see the LICENSE.md file for details