diff --git a/Utils.hs b/Utils.hs
new file mode 100644
--- /dev/null
+++ b/Utils.hs
@@ -0,0 +1,18 @@
+module Utils where
+
+import qualified Data.ByteString as S
+import qualified Data.ByteString.Lazy as L
+
+readFilesL :: [String] -> IO [L.ByteString]
+readFilesL args
+  | null args = fmap (:[]) L.getContents
+  | otherwise = mapM file args
+  where file "-" = L.getContents
+        file xs  = L.readFile xs
+
+readFilesS :: [String] -> IO [S.ByteString]
+readFilesS args
+  | null args = fmap (:[]) S.getContents
+  | otherwise = mapM file args
+  where file "-" = S.getContents
+        file xs  = S.readFile xs
diff --git a/json-tools.cabal b/json-tools.cabal
--- a/json-tools.cabal
+++ b/json-tools.cabal
@@ -1,6 +1,6 @@
 Name:           json-tools
 Cabal-Version:  >=1.6
-Version:        0.2.3
+Version:        0.2.4
 License:        BSD3
 License-File:   LICENSE
 Copyright:      (c) Nicolas Pouillard
@@ -35,6 +35,7 @@
 executable json-lines
     main-is: json-lines.hs
     Build-depends: base>=3&&<5, AttoJson, bytestring
+    Other-modules: Utils
     ghc-options: -Wall -Odph
 
 executable json-strings
@@ -45,6 +46,7 @@
 executable json-unlines
     main-is: json-unlines.hs
     Build-depends: base>=3&&<5, bytestring
+    Other-modules: Utils
     ghc-options: -Wall -Odph
 
 executable json-wrap
