summaryrefslogtreecommitdiff
path: root/README.rst
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2023-05-01 18:54:18 +0100
committerMichael Williamson <mike@zwobble.org>2023-05-01 19:08:37 +0100
commitbebc3653452c60e64e14a1a7d1b476ee75b2ae8a (patch)
treee2e3b89d183c23fab20b95bb4ed59b0cc279a80f /README.rst
parent888d37322643fd099008d76f12184648047d7204 (diff)
Add slurp support
Diffstat (limited to 'README.rst')
-rw-r--r--README.rst9
1 files changed, 9 insertions, 0 deletions
diff --git a/README.rst b/README.rst
index aa8cf49..15b7087 100644
--- a/README.rst
+++ b/README.rst
@@ -99,6 +99,15 @@ Call ``.input_text()`` to supply unparsed JSON text:
assert jq.compile(".").input_text("0.42").first() == 0.42
assert jq.compile(".").input_text("true").first() == True
assert jq.compile(".").input_text('"hello"').first() == "hello"
+ assert jq.compile(".").input_text("1\n2\n3").all() == [1, 2, 3]
+
+Pass ``slurp=True`` to ``.input_text()`` to read the entire input into an array:
+
+.. code-block:: python
+
+ import jq
+
+ assert jq.compile(".").input_text("1\n2\n3", slurp=True).first() == [1, 2, 3]
You can also call the older ``input()`` method by passing: