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

chialisp-preclsp

v1.0.0

Published

precompile chialisp for simple development

Readme

chialisp-preclsp

描述

  • 使用nodejs驱动chialisp代码,让使用chialisp变得更加简单易用。
  • 这个驱动代码作为学习调试chialisp非常好用,但是不建议在工程项目中使用。
  • 感谢chia团队,让我看到了更加有趣的未来。

运行环境

  • 安装chia-dev-tools,然后进入虚拟环境进行使用。

安装

手动安装(推荐)
	#安装
	git clone [email protected]:woaianqi/chialisp-preclsp.git 
    cd chialisp-preclsp 
    npm link
    #更新
    git pull
npm安装(不推荐)
	#不推荐使用该方法 因为代码库更新较为频繁
	npm install chialisp-preclsp -g

运行指令

   #运行clsp源文件
   preclsp x.clsp
   #运行js驱动代码 (文件必须以#!clsp开头,才会进行编译)
   preclsp x.js

驱动代码演示

clsp源程序(train0.clsp)
(mod (
	MY_PUZZLE_HASH
	my_amount
	)

	(defconstant CREATE_COIN 51)

	(list
		(list CREATE_COIN MY_PUZZLE_HASH my_amount)
	)

)
clsp驱动代码(driver0.js)
#!clsp

/**
	一个简单的智能货币
	定义一个收款地址
	消费时指定金额即可
	消费金额大于部署金额,会报错
	小于部署金额,剩余的部分会被当作矿工费哦。
	当然你也可以在脚本调用npm的包
*/

//开启debug,当前目录下会生成日志信息供调试
DEBUG()

//设置测试金额
const amount = @XCH(0.0001)

//指定一个clsp源程序文件并curry一个参数
const curryPuzzle = Puzzle.of("train0.clsp").curry(@ph1)

//部署这个合约到主网 立即得到交易对象
const transaction = curryPuzzle.deploy(@fp1,amount)

//等待主网确认交易,获得交易的货币
const coin = await transaction.getCoin()

//设置解决方案 消费该货币
const spentMsg = coin.setSolution([amount]).doSpent()

//如果消费成功,拿到消费的货币
if(spentMsg.success){

	//等待主网确认 获取消费后的货币
	const [spendCoin] = await spentMsg.getSpendCoins()

	//打印该货币
	spendCoin.print()
}
运行
preclsp driver0.js

具体教程