Buffering
-buffer creates buffer polygons around point, polyline or polygon features. When the input data is in longitude-latitude coordinates, Mapshaper creates geodesic buffers, so distances such as 500m or 2km are measured on the ground. Projected data is buffered in its planar coordinate system by default; add geodesic to use ground distances instead.
mapshaper rivers.shp -buffer 2km -o river_buffers.shp
Pink: source line. Black: buffer polygon.

Filling gaps
The fill-gaps option fills enclosed holes and narrow-mouthed inlets without growing the outer boundary. This is useful for filling rivers, bays, channels and other gaps inside a polygon layer while leaving the open coastline in place.
mapshaper states.shp -buffer 5km fill-gaps -o output.shp
The example below fills a long river inlet and some small gaps along the coastline while preserving the main outer boundary.

Use max-widening= with fill-gaps to limit how wide a gap may be before it is left open.
By default fill-gaps leaves small isolated islands separate rather than bridging them to a neighboring landmass across a narrow channel. Add merge-islands to bridge them as well.
Topological buffers
For polygon layers, the topological option buffers only unshared polygon boundaries, such as coastlines and holes. Shared boundaries between adjacent polygons are not buffered, and overlapping buffer areas are split between features by proximity.
mapshaper countries.shp -buffer 25km topological -o coast_buffers.shp
In the example below, buffers are created along coastlines, while internal borders are left unchanged.

Notes and limitations
- Geodesic buffers that cross the antimeridian are split and wrapped automatically. This support is still experimental.
- Geodesic buffer size is calculated using a spherical, not ellipsoidal, earth model, so it may not be accurate enough for GIS analysis.
- Polygon buffers that reach a pole use experimental polar handling. Geodesic line buffers cannot extend to the poles.
See the -buffer reference for the full set of options.