From 7b188170ebe48e68bf2aef2efd11b784134d8e4e Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 18 Apr 2023 19:23:35 -0400 Subject: [PATCH] README: move Node.js section down --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 727f00c..bc2af1c 100644 --- a/README.md +++ b/README.md @@ -100,14 +100,6 @@ You can also import from a tag: Therefore, to upgrade to a newer version of strfry-policies, you can simply change the import URL. -## Usage with Node.js - -We highly recommend running this library with Deno, but for those looking to incorporate it into an existing Node.js project, an NPM version is provided: - -- https://www.npmjs.com/package/strfry-policies - -This version is built with [dnt](https://github.com/denoland/dnt) which provides Node.js shims for Deno features. Some policies that rely on sqlite may not work, but core fuctionality and TypeScript types work fine, so it can be used as a framework to build other policies. - ## Writing your own policies You can write a policy in TypeScript and host it anywhere. Deno allows importing modules by URL, making it easy to share policies. @@ -218,6 +210,14 @@ Then, in the pipeline: - You should not use `console.log` anywhere in your policies, as strfry expects stdout to be the strfry output message. +## Usage with Node.js + +We highly recommend running this library with Deno, but for those looking to incorporate it into an existing Node.js project, an NPM version is provided: + +- https://www.npmjs.com/package/strfry-policies + +This version is built with [dnt](https://github.com/denoland/dnt) which provides Node.js shims for Deno features. Some policies that rely on sqlite may not work, but core fuctionality and TypeScript types work fine, so it can be used as a framework to build other policies. + ## Filtering jsonl events with your policy It is not currently possible to retroactively filter events on your strfry relay. You can however export the events with `strfry export`, filter them locally, and then import them into a fresh database. You can also use this command to filter Nostr events from any source, not just strfry.