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

mcs

v2.2.1

Published

A pre-processor to write Minecraft Functions more efficiently

Downloads

3

Readme

mcs: Minecraft Script

npm license

A pre-processor to write Minecraft Functions more efficiently.

Try it with the Online Editor!

Check out the changelog for a list of new features!

Latest Compatible Minecraft Version: 1.12

Note: I called it Script because it has a syntax similar to JavaScript.

Documentation

Learn how to write in Minecraft Script in the Wiki.

Installation

mcs has been tested with node and as a standalone (web) script. Though it should also support CommonJS (node, browserify) and AMD (RequireJS).

Node

Installation via npm:

$ npm install mcs

> var mcs = require('mcs');
> mcs('function hello { say hello world; }');

Alternatively you can install mcs globally so that it may be run from the command line.

$ npm install mcs -g
$ mcs ./input.mcs ./output/

Standalone/Script

Add to your html

<script src="https://unpkg.com/mcs"></script>

Or include it manually

Download mcs.min.js

Add to your html

<script src="path/to/mcs.min.js"></script>

Usage

JS

var input = 'function hello { say hello world; }'
var result = mcs(input)
// result = { "_namespace": { "_type": "namespace", "hello": { "_type": "function", "value": "say hello world\n" } } }

mcs() takes one required argument, the input (string to convert), and returns a JSON object with namespaces, groups, and functions (you can differentiate them using _type).

CLI

$ mcs [input] [output (optional)]

Using mcs in the CLI takes one require argument, the input file (.mcs file), and outputs to the (optional) output directory. If no output directory is given, ./ is used.

TODO

Check out the current todo list here.

Contributing

  1. Create an issue and describe your idea
  2. Fork it
  3. Checkout this repository
  4. Install the dependencies npm install or yarn
  5. Edit the files in /src
  6. Test your changes with
# Use your own input/output
$ npm run build
$ node index.js [input] [output]


# Alternatively:
# Use test/new_syntax.mcs as input, and test/output/ as output
$ npm run test

# Build the source files AND use test/new_syntax.mcs as input, and test/output/ as output
$ npm run bnt

# Autocompile/build whenever you change the src files (instead of npm run build)
$ gulp
  1. You can also test your changes on the web by copying the dist/mcs.min.js file after building
  2. Once done, create a pull request

Authors

Made by Pandawan.
Thanks to @coolsa for contributing. Thanks to Andrew Mast and Chris Smith for helping out and providing feedback!

License

Please see the LICENSE file

mcs is not affiliated with Minecraft or Mojang AB.