
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
@archetype-org/clack
Advanced tools
a nodejs library for sending IPC commands to an Urbit ship over Conn.c
a nodejs library for sending IPC commands to an Urbit ship over Conn.c
To start using %clack in your node project install with npm:
npm install --save @archetype-org/clack
Basic usage has the following pattern.
import { Clack } from '@archetype-org/clack'
const clack = Clack({ ship: './path/to/your/zod' })
const noun = await clack.createDesk('%js-created')
In this example, the top level Clack
object is imported from the package, and then initialized with the path to the ship you want to connect to through conn.c
/kahn
. Once it is setup, you can use the Clack object's methods, such as clack.createDesk()
to script the behavior of your ship
If you know hoon, you can also directly send threads or any other %fyrd
message to the ship using long form templatestrings for your hoon code. We expose the sendKahn()
Function to allow this:
import { sendKahn, Thread, parseThreadResponse } from '@archetype-org/clack'
sendKahn({
ship: './path/to/your/zod',
hoon: Thread(`
=/ m (strand ,vase)
;< ~ bind:m
~& (add 40 2)
(poke [~zod %hood] %helm-hi !>(\'\'))
(pure:m !>([%res 'success']))
`),
responseParser: parseThreadResponse,
})
Below You can find the full API reference for the methods and functions exported by the library. In addition to the top level clack
object, we also expose some internal methods useful for advanced users sending custom messages through conn.c
. These generally fall into two categories: encoding functions for doing bitwise operations to nouns an atoms (i.e. newt-encoding) and Khan specific types that provide more syntactic sugar for formatting nouns than using nockjs directly.
Takes a payload object that specifies a ship, and returns a Clack
instance that controls that ship. Implemented as a closure, does not require the new
keyword to create.
Takes a deskname and creates/mounts it in the controlled desk
%
etc.)Encoding functions: converting between hoon Atoms and JS primitives, and newt encoding/decoding.
Dev Note: parts of these use python subprocesses to do byte manipulation because it is more strightforward than using Buffers for everything; there should be no system dependancies aside from a working python 2 or 3 installation
Takes a string that casts to a JS primitive and transforms it into a nock atom; uses BigInt to represent the atom.
Takes a nockJS atom object and decodes the atom.number
property to a string which can be parsed to a JS primitive
%foo
as part of the return atom, it will come over as 'foo'
Not '%foo'
on the JS sideTakes a Buffer (received through Conn.c) and decodes it into a nockjs Atom
object.
atom.number property
will still be a jammed noun, which will need to be cue
d for further decoding of it's children.Takes a nockjs Atom object (ideally a jammed noun) and encodes it with newt encoding for sending over the wire.
jam
it anywaysconn.c
or %lick
JS constructor for structuring a %fyrd
in nockjs Cell
s.
desk
)
'khan-eval'
(NOT: '%khan-eval'
)'work'
(NOT: '%work'
or -work
)@tas
determining the output type, must have a valid mark
in the desk to run
'noun'
(NOT: '%noun'
)'text'
(NOT: '%text'
)@tas
determining the input type, must have a valid mark
in the desk to run
'ted-eval'
(NOT: '%ted-eval'
)'noun'
(NOT: '%noun'
)thread
)Fyrd
composed of Nockjs Cell
sJS constructor for structuring a %fyrd
for running custom threads. wraps nockjs nouns.
Fyrd
composed of Nockjs Cell
sDecodes a buffer of data received from conn.c
and parses the response. Assumes that the data is structured as the result of a %fyrd
(e.g. begins with %avow
and %noun
). Returns null
if it can't be parsed as a %fyrd
response.
%fyrd response
Cell
containing the return value of the thread with %avow
and %noun
stripped away from the headTakes a payload with the ship to control, the noun to send, and the parser for getting the result, and then sends them to khan. Returns the parsed result.
Fyrd
, Thread
or something customconn.c
if you are developing or extending %clack you probably want to pull it from git instead of npm/yarn. It can be cloned from here:
git clone https://github.com/archetype-org/clack.git
cd ./clack
Once you are in the project, the tests can be run with:
npm test
clack uses jest, which will scan your project for files that fit the pattern \*.test.js
and will run any test()
functions defined in those files. You can add to the test suite in that file, or create additional ones as needed.
If you want to fix bugs or add features please submit a PR with the github issue, if it exists. included in the branch name.
FAQs
a nodejs library for sending IPC commands to an Urbit ship over Conn.c
The npm package @archetype-org/clack receives a total of 0 weekly downloads. As such, @archetype-org/clack popularity was classified as not popular.
We found that @archetype-org/clack demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.