To share spreadsheets and documents it is easy to write a script:
var sheet = SpreadsheetApp.openById("xxxxxxxxxxxxxxxxxxxxxxxx");
sheet.addViewer("[email protected]");
A libray ia a stand alone Google Apps Script file. Is there a comparable script to share such a file?