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

@kipper/core

v0.12.0

Published

The core implementation of the Kipper compiler 🦊

Downloads

999

Readme

Kipper Core Package - @kipper/core 🦊✨

Version Dev Version codecov Issues License Install size Publish size DOI

The core module for Kipper, which contains the primary language and compiler. ⌨️✨

Kipper is a JavaScript-like strongly and strictly typed language with Python flavour. It aims to provide straightforward, simple, secure and type-safe coding with better efficiency and developer satisfaction!

It compiles to both JavaScript and TypeScript, and can be set up in your terminal, Node.js or ES6+ browser. 🦊💻

For more details, you can read more about this project on the project repository and the Kipper website.

Installation

To install the package, run the following command:

npm i @kipper/core

If you are using pnpm or yarn, use pnpm i @kipper/core or yarn add @kipper/core.

General Information

How to use Kipper?

To use Kipper you have three options:

In a browser with @kipper/web 🦊🌐

For running Kipper in the browser, you will have to include the kipper-standalone.js file, which provides the Kipper Compiler for the browser and enables the compilation of Kipper code to JavaScript.

Simple example of compiling and running Kipper code in a browser:

<!-- Kipper dependency -->
<script src="https://cdn.jsdelivr.net/npm/@kipper/web@latest/kipper-standalone.min.js"></script>

<!-- You won't have to define Kipper or anything after including the previous file. It will be defined per default  -->
<!-- with the global 'Kipper' -->
<script type="module">
	const compiler = new Kipper.KipperCompiler();

	// Compile the code to JavaScript
	// Top-level await ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await#top_level_await
	const result = await compiler.compile(`print("Hello world!");`, { target: new KipperJS.TargetJS() });
	const jsCode = result.write();

	// Finally, run your program
	eval(jsCode);
</script>

Locally using Node.js with @kipper/cli 🦊🖥️

This is to recommend way to use Kipper if you want to dive deeper into Kipper, as it allows you to locally use and run kipper, without depending on a browser.

For example:

  • Compiling a Kipper program:
    kipper compile file.kip
  • Executing a Kipper program using Node.js:
    kipper run file.kip

This also enables the usage of Kipper files with the .kip extension, which can be read and compiled to TypeScript, without having to configure anything yourself. This also allows the input of data over the console and file-interactions, which are not supported inside a browser.

For more info go to the @kipper/cli README.

Locally in your own code with @kipper/core 🦊⌨️

This is the recommended way if you intend to use kipper in a workflow or write code yourself to manage the compiler. This also allows for special handling of logging and customising the compilation process.

Simple example of using the Kipper Compiler in Node.js:

  • JavaScript (CommonJS):

    const fs = require("fs").promises;
    const kipper = require("@kipper/core");
    const kipperJS = require("@kipper/target-js");
    
    const path = "INSERT_PATH";
    fs.readFile(path, "utf8").then(async (fileContent) => {
    	const compiler = new kipper.KipperCompiler();
    
    	// Compile the code string or stream
    	let result = await compiler.compile(fileContent, { target: new kipperJS.TargetJS() });
    	let jsCode = result.write();
    
    	// Running the Kipper program
    	eval(jsCode);
    });
  • TypeScript (CommonJS):

    import { promises as fs } from "fs";
    import { KipperCompiler } from "@kipper/core";
    import { TargetJS } from "@kipper/target-js";
    
    const path = "INSERT_PATH";
    fs.readFile(path, "utf8" as BufferEncoding).then(async (fileContent: string) => {
    	const compiler = new KipperCompiler();
    
    	// Compile the code string or stream
    	let result = await compiler.compile(fileContent, { target: new TargetJS() });
    	let jsCode = result.write();
    
    	// Running the Kipper program
    	eval(jsCode);
    });

Contributing to Kipper

If you want to contribute to Kipper, we have a full guide explaining the structure of Kipper and how to use GitHub issues and pull requests. Check it out here!

If you have any questions or concerns, you can open up a discussion page here!

We appreciate any feedback or help! Kipper is open-source and free for anyone, help us make it even better! 🦊❤️

Copyright and License

License FOSSA Status

Copyright (C) 2021-2024 Luna Klatzer

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

See the LICENSE for information on terms & conditions for usage.

FOSSA License Report

FOSSA Status